Creates a new AsyncLogger instance.
Optional
options: AsyncLoggerOptions = {}Configuration options
Template literal formatter for inline styling. Uses the same TemplateParser as Logger for consistency.
Template formatter function
Alias for the style builder (s). Provides a more descriptive name for the chainable style API.
Chainable style builder
Logs a debug-level message.
Debug message
Optional
meta: Record<string, unknown>Optional metadata
Result of the log operation
Flushes the current batch to workers or transports.
Promise that resolves when flush is complete
Flushes all pending logs and waits for completion.
Promise that resolves when flush is complete
Gets current performance metrics.
Current metrics
Gets current logger statistics including buffer information.
Statistics object with buffer and performance info
Gets the current buffer utilization percentage.
Utilization percentage (0-100)
Checks if the logger is experiencing backpressure.
True if backpressured
Lists all transport names.
Array of transport names
Logs a critical message with retry on failure.
Log level
Log message
Optional
meta: Record<string, unknown>Optional metadata
Promise that resolves when logged
Removes a transport from the logger.
Name of transport to remove
Waits for logger initialization to complete.
Resolves when ready
Logs a warning-level message.
Warning message
Optional
meta: Record<string, unknown>Optional metadata
Result of the log operation
High-performance asynchronous logger using worker threads.
Offloads CPU-intensive operations like serialization and I/O to worker threads, keeping the main event loop responsive. Ideal for high-throughput applications that cannot afford blocking operations.
AsyncLogger
Since
1.0.0
Example: Basic usage
Example: With metrics monitoring