static/jsvm/interfaces/slog.Logger.html
A Logger records structured information about each call to its Log, Debug, Info, Warn, and Error methods. For each call, it creates a [Record] and passes it to a [Handler].
To create a new Logger, call [New] or a Logger method that begins "With".
debugdebugContextenablederrorerrorContexthandlerinfoinfoContextloglogAttrswarnwarnContextwithwithGroup
Debug logs at [LevelDebug].
Rest ...args: any[]DebugContext logs at [LevelDebug] with the given context.
Rest ...args: any[]Enabled reports whether l emits log records at the given context and level.
Error logs at [LevelError].
Rest ...args: any[]ErrorContext logs at [LevelError] with the given context.
Rest ...args: any[]Handler returns l's Handler.
Info logs at [LevelInfo].
Rest ...args: any[]InfoContext logs at [LevelInfo] with the given context.
Rest ...args: any[]Log emits a log record with the current time and the given level and message. The Record's Attrs consist of the Logger's attributes followed by the Attrs specified by args.
The attribute arguments are processed as follows:
- If an argument is an Attr, it is used as is. - If an argument is a string and this is not the last argument, the following argument is treated as the value and the two are combined into an Attr. - Otherwise, the argument is treated as a value with key "!BADKEY".Copy
Rest ...args: any[]LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs.
Rest ...attrs: Attr[]Warn logs at [LevelWarn].
Rest ...args: any[]WarnContext logs at [LevelWarn] with the given context.
Rest ...args: any[]With returns a Logger that includes the given attributes in each output operation. Arguments are converted to attributes as if by [Logger.Log].
Rest ...args: any[]WithGroup returns a Logger that starts a group, if name is non-empty. The keys of all attributes added to the Logger will be qualified by the given name. (How that qualification happens depends on the [Handler.WithGroup] method of the Logger's Handler.)
If name is empty, WithGroup returns the receiver.
OSLightDark
Generated using TypeDoc