Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug() *zerolog.Event

Debug logs a message at debug level

func Error

func Error() *zerolog.Event

Error logs a message at error level

func Fatal

func Fatal() *zerolog.Event

Fatal logs a message at fatal level and exits

func Get

func Get() *zerolog.Logger

Get returns the global logger instance

func GetLevel

func GetLevel() zerolog.Level

GetLevel returns the current log level

func Info

func Info() *zerolog.Event

Info logs a message at info level

func Init

func Init(cfg Config)

Init initializes the global logger with the provided configuration

func SetLevel

func SetLevel(level zerolog.Level)

SetLevel changes the global log level

func Trace

func Trace() *zerolog.Event

Trace logs a message at trace level (most verbose)

func Warn

func Warn() *zerolog.Event

Warn logs a message at warn level

func WithCommand

func WithCommand(command string) zerolog.Logger

WithCommand returns a logger with command context

func WithContext

func WithContext(fields map[string]interface{}) zerolog.Logger

WithContext returns a logger with additional context fields

func WithRequestID

func WithRequestID(requestID string) zerolog.Logger

WithRequestID returns a logger with request ID context

Types

type Config

type Config struct {
	Verbosity int       // Verbosity level: 0=warn, 1=info, 2=debug, 3+=trace
	Quiet     bool      // Only error level logging
	JSON      bool      // Output in JSON format
	Writer    io.Writer // Output writer (defaults to os.Stderr)
}

Config holds logger configuration

Jump to

Keyboard shortcuts

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