DebugLogger
Class: DebugLogger
Defined in: packages/workout/src/loggers/debug.ts:16
Debug logger that writes all messages (including non-log events) to a file in JSON format Useful for debugging and troubleshooting by capturing the complete message stream
Example
const output = new WorkerOutput();
new DebugLogger(output, "/var/log/debug.log");
output.log("INFO", "Test"); // Writes full JSON message
output.startProgress("task", 100); // Also captured
Extends
Constructors
Constructor
new DebugLogger(
output,filepath):DebugLogger
Defined in: packages/workout/src/loggers/debug.ts:22
Create a new debug logger
Parameters
output
WorkerOutput instance to listen to
filepath
string
Path to the debug log file
Returns
DebugLogger
Overrides
Properties
filepath
filepath:
string
Defined in: packages/workout/src/loggers/file.ts:24
Path to the log file
Inherited from
format
format:
string
Defined in: packages/workout/src/loggers/file.ts:28
Format string for log messages
Inherited from
outputCount
outputCount:
number=0
Defined in: packages/workout/src/loggers/file.ts:22
Current size of the log file in bytes
Inherited from
outputStream?
optionaloutputStream?:WriteStream
Defined in: packages/workout/src/loggers/file.ts:20
Write stream for the log file
Inherited from
sizeLimit
sizeLimit:
number
Defined in: packages/workout/src/loggers/file.ts:26
Maximum file size before rotation in bytes
Inherited from
Methods
filter()
filter():
boolean
Defined in: packages/workout/src/loggers/debug.ts:30
Accept all messages without filtering
Returns
boolean
Always returns true to log all message types
Overrides
getLine()
getLine(
msg):string
Defined in: packages/workout/src/loggers/debug.ts:39
Format a message as a JSON string with type and timestamp
Parameters
msg
The message to format
Returns
string
JSON formatted log line with newline
Overrides
onMessage()
onMessage(
msg):void
Defined in: packages/workout/src/loggers/file.ts:58
Process a WorkerMessage and write it to the log file
Parameters
msg
The message to process
Returns
void
Inherited from
rotateLogs()
rotateLogs(
filepath):void
Defined in: packages/workout/src/loggers/file.ts:119
Rotate the log file by renaming it with a numeric suffix Creates a new empty log file at the original path
Parameters
filepath
string
Path to the log file to rotate
Returns
void