Documentation Index
Fetch the complete documentation index at: https://bytekit.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Import
Constructor
Config options
| Property | Type | Default | Description |
|---|---|---|---|
level | "debug" | "info" | "warn" | "error" | "info" | Minimum severity level to emit |
namespace | string | — | Prefix prepended to every message |
formatter | (level, message, ...args) => string | — | Custom message formatting function |
transports | Transport[] | — | Array of output targets |
silent | boolean | false | When true, suppresses all output |
Log levels
Levels are ordered by severity. Setting a level silences everything below it.| Level | Severity |
|---|---|
debug | Lowest — verbose development output |
info | General operational messages |
warn | Potential issues worth investigating |
error | Highest — failures that need attention |
Methods
| Method | Returns | Description |
|---|---|---|
debug(message, ...args) | void | Logs at debug level |
info(message, ...args) | void | Logs at info level |
warn(message, ...args) | void | Logs at warn level |
error(message, ...args) | void | Logs at error level |
log(level, message, ...args) | void | Logs at an explicit level |
setLevel(level) | void | Changes the minimum level at runtime |
child(namespace) | Logger | Creates a child logger with a prefixed namespace |
addTransport(transport) | void | Adds an output target at runtime |
removeTransport(transport) | void | Removes a previously added transport |
Transport interface
Any object that implements the following method can be used as a transport:
createLogger factory
Shortcut that creates and returns a Logger instance. Accepts the same config as the constructor.
Examples
Basic usage
Child loggers
Create scoped loggers that inherit the parent’s config and prepend a namespace.Custom transport
Runtime level switching
Silent mode for tests
The default transport writes to
console. Add custom transports to send logs to files, remote services, or monitoring tools.