stdlog

package
v0.0.0-...-f3811d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultKeySeparator = "_"

DefaultKeySeparator is the default separator for group key prefixes.

Variables

This section is empty.

Functions

func New

func New(opts ...LogOption) (unilog.Logger, error)

New creates a new unilog.Logger instance backed by the standard log.

Types

type LogOption

type LogOption func(*logOptions) error

LogOption configures the standard logger creation.

func WithCaller

func WithCaller(enabled bool, skip ...int) LogOption

WithCaller enables source injection. Optional skip overrides the user skip frames.

func WithLevel

func WithLevel(level unilog.LogLevel) LogOption

WithLevel sets the minimum log level.

func WithOutput

func WithOutput(w io.Writer) LogOption

WithOutput sets the output writer.

func WithSeparator

func WithSeparator(separator string) LogOption

WithSeparator sets the separator for group key prefixes.

func WithTrace

func WithTrace(enabled bool) LogOption

WithTrace enables stack traces for ERROR and above.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL