Structured logger that writes JSON lines (or pretty text) to console.
-
child(bindings: LogMetadata): ILogger
Returns a new logger whose entries always include
bindingsmerged on top of this logger's existing bindings. -
debug(): voidmessage: string,metadata?: LogMetadata
-
error(): voidmessage: string,metadata?: LogMetadata
-
fatal(): voidmessage: string,metadata?: LogMetadata
-
info(): voidmessage: string,metadata?: LogMetadata
-
level: LogLevel
The minimum level this logger emits.
-
trace(): voidmessage: string,metadata?: LogMetadata
-
warn(): voidmessage: string,metadata?: LogMetadata
Logger that does nothing. Every method is a no-op and child() returns
the same instance, so it is cheap to share widely.
-
child(_bindings: LogMetadata): ILogger
Returns this same instance — a no-op logger has no state to fork.
-
debug(): void_message: string,_metadata?: LogMetadata
-
error(): void_message: string,_metadata?: LogMetadata
-
fatal(): void_message: string,_metadata?: LogMetadata
-
info(): void_message: string,_metadata?: LogMetadata
-
level: LogLevel
The configured level; defaults to
trace. No output is ever produced. -
trace(): void_message: string,_metadata?: LogMetadata
-
warn(): void_message: string,_metadata?: LogMetadata
Structured logger backed by Pino.
-
child(bindings: LogMetadata): ILogger
Returns a child logger backed by Pino's native
child(). -
create(options?: PinoLoggerOptions): Promise<PinoLogger>
Asynchronously creates a
PinoLogger. -
debug(): voidmessage: string,metadata?: LogMetadata
-
error(): voidmessage: string,metadata?: LogMetadata
-
fatal(): voidmessage: string,metadata?: LogMetadata
-
info(): voidmessage: string,metadata?: LogMetadata
-
level: LogLevel
The minimum level this logger emits.
-
trace(): voidmessage: string,metadata?: LogMetadata
-
warn(): voidmessage: string,metadata?: LogMetadata
Creates middleware that logs each request and its response.
Creates the LoggerPlugin.
Options for constructing a ConsoleLogger.
-
bindings: LogMetadata
Bindings merged into every entry produced by this logger.
-
level: LogLevel
Minimum level to emit. Defaults to
'info'. -
pretty: boolean
When
true, pretty-print entries instead of emitting JSON lines. -
redact: readonly string[]
Dot-paths to redact from metadata (e.g.
['password', 'auth.token']).
Options for LoggerPlugin.
-
excludePaths: readonly string[]
Exact paths excluded from request logging.
-
level: LogLevel
Minimum level to emit. Defaults to
'info'. -
pinoFactory: PinoFactory
Inject a pre-loaded Pino factory for the pino transport, bypassing the
import('npm:pino')path. Useful for tests. -
pretty: boolean
When
true(andtransport: 'console'), pretty-print entries. -
redact: readonly string[]
Dot-paths to redact from metadata (e.g.
['password', 'token']). -
requestLogging: boolean
When
true, register automatic request/response logging middleware. -
slowRequestThreshold: number
Requests slower than this (ms) trigger a
warnentry. Defaults to5000. -
transport: LoggerTransport
Underlying logger implementation. Defaults to
'console'.
Options for constructing a NoopLogger. Currently unused but
kept for a stable, forward-compatible constructor signature that mirrors
the other logger implementations.
-
bindings: LogMetadata
Accepted for API symmetry; ignored.
-
level: LogLevel
Accepted for API symmetry; ignored.
Options for constructing a PinoLogger.
-
bindings: LogMetadata
Bindings merged into every entry produced by this logger.
-
level: LogLevel
Minimum level to emit. Defaults to
'info'. -
pinoFactory: PinoFactory
Inject a pre-loaded Pino factory, bypassing the
import('npm:pino@10.x')path. Useful for tests and environments where the module is already available in-memory. -
redact: readonly string[]
Dot-paths to redact from metadata, delegated to Pino's built-in redaction.
Options for createRequestLoggerMiddleware.
-
excludePaths: readonly PathPattern[]
Paths to skip logging (e.g.
['/health']). A string is an EXACT match; aRegExpis tested against the path. -
slowRequestThreshold: number
Requests slower than this (ms) trigger a
warnentry. Defaults to5000.
Selects the underlying logger implementation.
Factory signature for creating a Pino logger instance. Matches the shape
of the pino default export and allows tests to inject a stub.
Usage
import * as Structured_logging_plugin_for_the_Setu_TS_framework___Provides_three_logger_implementations____ConsoleLogger____PinoLogger___and__NoopLogger____and_automatic_request_response_logging_middleware__all_registered_under__CAPABILITIES_LOGGER__by_the__LoggerPlugin____Every_export_here_is_public_API_and_documented_in_PUBLIC_API_md__AI_GUIDELINES__10__ from "logger-plugin/src/index.ts";