Documentation
¶
Overview ¶
Package log contains functions used internally for logging to a default logger implementing slog.Logger. The default logger can be set using [logger.SetDefault].
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Default ¶ added in v0.7.0
Default returns the default logger. This method is guaranteed to always return a value, even if the default has explicitly beed set to nil. If no default has been configured, or overriden by a nil value, the logger will discard all logged messages.
func ErrAttr ¶ added in v0.7.0
ErrAttr creates a log record attribute representing an error.
If the error originates from V8, the relevant JavaScript location and stack trace are included in the log record.
func ReplaceStackAttr ¶ added in v0.10.3
ReplaceStackAttr removes "stack" entries from log output. While stack output can be beneficial in some scenarios, it's very verbose.
There is also a security consideration, stack output can expose details about the inner workings of the system, that can be exploited to find weaknesses. The intended use case of this library is not production use, there are still risks log messages leak, e.g., build logs.
func SetDefault ¶
Set a default slog/Logger instance to use in contexts where a specific logger has not been set. If no default logger is set, the default will discard all log messages.
Types ¶
type LoggerLogSource ¶ added in v0.5.1
func (LoggerLogSource) Logger ¶ added in v0.5.1
func (s LoggerLogSource) Logger() Logger