Logger beta
Class of @v12-engine/engine
export declare class LoggerA logger: it takes entries of a level and above and sends them to its sinks and its parent
Members
constructor
constructor(options?: LoggerOptions);Constructs a new instance of the Logger class
child
child(options?: Omit<LoggerOptions, 'parent'> | LogContext): Logger;A logger under this one: its entries carry what context adds, and are passed up here
debug
debug(category: string, message: string, fields?: Record<string, unknown>): void;Says a debug entry
error
error(category: string, message: string, fields?: Record<string, unknown>): void;Says an error entry
info
info(category: string, message: string, fields?: Record<string, unknown>): void;Says an info entry
level
level: LogLevel;The least an entry must matter to be said: what is under it is dropped here, and goes no further
log
log(level: LogLevel, category: string, message: string, fields?: Record<string, unknown>): void;Says an entry of the level, the category and the message, with its fields when given; dropped when the logger does not say that level
pass
pass(entry: LogEntry): void;Takes an entry made elsewhere (a world's, by the client that shows it; a server's, sent to a tool) as if it was said here: to this logger's sinks, and up. What it already says of its game and its tick is kept
says
says(level: LogLevel): boolean;Whether an entry of this level would be said: for not putting together what nobody will read
to
to(sink: LogSink): () => void;Sends this logger's entries, and those of every logger under it, to a sink. Returns what stops it
warn
warn(category: string, message: string, fields?: Record<string, unknown>): void;Says a warn entry