Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶ added in v0.0.9
func NewLogger(opts ...LoggingOptions) *slog.Logger
func NewNullLogger ¶ added in v0.0.11
Types ¶
type LoggingOptions ¶ added in v0.0.16
type LoggingOptions struct { // Filepath | "" or "stderr" for stderr | "stdout" for stdout (default "") Target string // adds a "2006_01_02_15_04_05" timestamp to the log file name // Not compatible with stderr/stdout (default false) PrefixFilenameWithTime bool // Whether to add the source location of the call to log (default false) AddSource bool // Minimum level to log for this handler (default INFO) Level slog.Level // false means TextHandler, true means JsonHandler // overridden by CustomHandler (default false) JsonHandler bool // ReplaceAttrs are called to rewrite each attribute before it is logged. (default nil) ReplaceAttrs []func(attrGroups []string, a slog.Attr) slog.Attr // Your custom handler, overrides all other fields (default nil) CustomHandler slog.Handler }
LoggingOptions describes a handler
func (LoggingOptions) Handler ¶ added in v0.0.16
func (o LoggingOptions) Handler() slog.Handler
Handler instantiates a new handle based on the requested options
type NullHandler ¶ added in v0.0.11
type TeeHandler ¶ added in v0.0.9
func NewTeeHandler ¶ added in v0.0.9
func NewTeeHandler(handlers ...slog.Handler) *TeeHandler
Click to show internal directories.
Click to hide internal directories.