MCPcopy Index your code
hub / github.com/Noumena-Network/code / logForDebugging

Function logForDebugging

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

Source from the content-addressed store, hash-verified

373}
374
375export function logForDebugging(
376 message: string,
377 { level }: { level: DebugLogLevel } = {
378 level: 'debug',
379 },
380): void {
381 if (LEVEL_ORDER[level] < LEVEL_ORDER[getMinDebugLogLevel()]) {
382 return
383 }
384 if (!shouldLogDebugMessage(message)) {
385 return
386 }
387
388 // Multiline messages break the jsonl output format, so make any multiline messages JSON.
389 if (hasFormattedOutput && message.includes('\n')) {
390 message = jsonStringify(message)
391 }
392 const timestamp = new Date().toISOString()
393 const output = `${timestamp} [${level.toUpperCase()}] ${message.trim()}\n`
394 if (isDebugToStdErr()) {
395 writeToStderr(output)
396 return
397 }
398
399 getDebugWriter().write(output)
400}
401
402export function getDebugLogPath(): string {
403 return (

Callers 15

mtls.tsFile · 0.70
getTLSFetchOptionsFunction · 0.70
clearMTLSCacheFunction · 0.70
configureGlobalMTLSFunction · 0.70
parseFrontmatterFunction · 0.70
parseShellFrontmatterFunction · 0.70
fileHistoryTrackEditFunction · 0.70
fileHistoryMakeSnapshotFunction · 0.70
fileHistoryRewindFunction · 0.70
applySnapshotFunction · 0.70
copyFileHistoryForResumeFunction · 0.70

Calls 6

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

Tested by

no test coverage detected