MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / logForDebugging

Function logForDebugging

source code/utils/debug.ts:205–230  ·  view source on GitHub ↗
(
  message: string,
  { level }: { level: DebugLogLevel } = {
    level: 'debug',
  },
)

Source from the content-addressed store, hash-verified

203}
204
205export function logForDebugging(
206 message: string,
207 { level }: { level: DebugLogLevel } = {
208 level: 'debug',
209 },
210): void {
211 if (LEVEL_ORDER[level] < LEVEL_ORDER[getMinDebugLogLevel()]) {
212 return
213 }
214 if (!shouldLogDebugMessage(message)) {
215 return
216 }
217
218 // Multiline messages break the jsonl output format, so make any multiline messages JSON.
219 if (hasFormattedOutput && message.includes('\n')) {
220 message = jsonStringify(message)
221 }
222 const timestamp = new Date().toISOString()
223 const output = `${timestamp} [${level.toUpperCase()}] ${message.trim()}\n`
224 if (isDebugToStdErr()) {
225 writeToStderr(output)
226 return
227 }
228
229 getDebugWriter().write(output)
230}
231
232export function getDebugLogPath(): string {
233 return (

Callers 15

makeLogEntryReaderFunction · 0.85
immediateFlushHistoryFunction · 0.85
getSkillsFunction · 0.85
commands.tsFile · 0.85
queryLoopFunction · 0.85
runFunction · 0.85
connectMcpBatchFunction · 0.85
formatCommandDescriptionFunction · 0.85
executeForkedSkillFunction · 0.85
callFunction · 0.85
executeRemoteSkillFunction · 0.85
maybeInvalidateCacheFunction · 0.85

Calls 5

shouldLogDebugMessageFunction · 0.85
jsonStringifyFunction · 0.85
writeToStderrFunction · 0.85
getDebugWriterFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected