MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / setLogPath

Function setLogPath

cli/src/utils/logger.ts:71–96  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

69}
70
71function setLogPath(p: string): void {
72 if (p === logPath) return // nothing to do
73
74 logPath = p
75 mkdirSync(dirname(p), { recursive: true })
76
77 // ──────────────────────────────────────────────────────────────
78 // pino.destination(..) → SonicBoom stream, no worker thread
79 // ──────────────────────────────────────────────────────────────
80 const fileStream = pino.destination({
81 dest: p, // absolute or relative file path
82 mkdir: true, // create parent dirs if they don’t exist
83 sync: true, // set true if you *must* block on every write
84 })
85
86 pinoLogger = pino(
87 {
88 level: 'debug',
89 formatters: {
90 level: (label) => ({ level: label.toUpperCase() }),
91 },
92 timestamp: () => `,"timestamp":"${new Date().toISOString()}"`,
93 },
94 fileStream, // <-- no worker thread involved
95 )
96}
97
98export function clearLogFile(): void {
99 const projectRoot = getProjectRoot()

Callers 1

sendAnalyticsAndLogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected