MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / constructor

Method constructor

src/lib/logger.js:27–41  ·  view source on GitHub ↗
(
		maxBufferSize = 1000,
		logLevel = "info",
		flushInterval = 30000,
		maxFileSize = 10 * 1024 * 1024,
	)

Source from the content-addressed store, hash-verified

25 #maxFileSize;
26
27 constructor(
28 maxBufferSize = 1000,
29 logLevel = "info",
30 flushInterval = 30000,
31 maxFileSize = 10 * 1024 * 1024,
32 ) {
33 this.#logBuffer = new Map();
34 this.#maxBufferSize = maxBufferSize;
35 this.#logLevel = logLevel;
36 this.#logFileName = config.LOG_FILE_NAME;
37 this.#flushInterval = flushInterval;
38 this.#maxFileSize = maxFileSize;
39 this.#startAutoFlush(); // Automatically flush logs at intervals
40 this.#setupAppLifecycleHandlers(); // Handle app lifecycle events for safe log saving
41 }
42
43 /**
44 * Logs a message with the specified log level.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected