( maxBufferSize = 1000, logLevel = "info", flushInterval = 30000, maxFileSize = 10 * 1024 * 1024, )
| 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. |
nothing calls this directly
no outgoing calls
no test coverage detected