MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / rotateIfNeeded

Method rotateIfNeeded

packages/node-runtime/src/logging/app-logger.ts:73–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72 // ponytail: rename-based rotation, atomic, no rewrite, ~20MB total ceiling
73 private rotateIfNeeded(): void {
74 let size = 0
75 try {
76 size = fs.statSync(this.logFile).size
77 } catch {
78 return // file doesn't exist yet
79 }
80 if (size < MAX_SIZE_BYTES) return
81 fs.renameSync(this.logFile, this.oldLogFile) // overwrites previous .old, atomic
82 }
83}
84
85function resolveThreshold(): LogLevel {

Callers 1

writeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected