MCPcopy
hub / github.com/opentrace/opentrace / configureDebug

Function configureDebug

plugins/opencode/src/util/debug.ts:106–119  ·  view source on GitHub ↗
(opts: { debug?: boolean; debugFile?: string })

Source from the content-addressed store, hash-verified

104 * if `debugFile` is set. Debug is off by default.
105 */
106export function configureDebug(opts: { debug?: boolean; debugFile?: string }): void {
107 enabled = opts.debug === true
108 if (opts.debugFile) {
109 logFile = opts.debugFile
110 logDirReady = false
111 }
112 if (!enabled) return
113 // Handle rotation at config time so a long-lived log doesn't survive forever
114 // if a user only hits low-frequency code paths during a session.
115 rotateIfNeeded()
116 write(
117 `${new Date().toISOString()} [opentrace:plugin] debug enabled logFile=${JSON.stringify(logFile)} pid=${process.pid}\n`,
118 )
119}

Callers 5

index.test.tsFile · 0.85
makeClientFunction · 0.85
debug.test.tsFile · 0.85
serverFunction · 0.85

Calls 2

rotateIfNeededFunction · 0.85
writeFunction · 0.70

Tested by 1

makeClientFunction · 0.68