import { $logger } from "https://deno.land/x/dxx@rf/src/lib/$shared.ts";
const { Logger } = $logger;
Logger. This is what we write to.
Examples
Creation
Creation
// Via class
import { Logger } from 'caterpillar'
const logger = new Logger()
Constructors
new
Logger(fn?: TransformInContextFn<LoggerInT, O>, options?: LoggerOptions)Create our instance and apply our configuration options.
Type Parameters
optional
O = LogEntryMethods
chain<T>(t: TransformWriter<O, T>): Logger<T>
debug(...args: unknown[])
Alias for log()
which prefixes the debug log level.
error(...args: unknown[])
Alias for log()
which prefixes the 'error' log level.
info(...args: unknown[])
Alias for log()
which prefixes the info log level.
log(...args: unknown[])
Log the arguments into the logger transform stream.
logLevelDetail(value?: number | string)
Alias for logLevelDetail using the configured logger levels.
mergeMetadata(data: AnObject)
note(...args: unknown[])
Alias for log()
which prefixes the info log level.
resetMetadata(data: AnObject)
resume()
suspend()
trace(...args: unknown[])
Alias for log()
which prefixes the trace log level.
warn(...args: unknown[])
Alias for log()
which prefixes the warn log level.
warning(...args: unknown[])
(Another common) alias for log()
which prefixes the warn log level.
Static Methods
LoggerTransformFn(context_: unknown | null, args_: unknown | unknown[]): LogEntry | undefined
Takes an arguments array and transforms it into a log entry.