Thanks to visit codestin.com
Credit goes to pkg.go.dev

logger

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

Debug logs a debug message

func Debugf

func Debugf(msg string, fields map[string]interface{})

Debugf logs a debug message with fields

func Error

func Error(msg string)

Error logs an error message

func Errorf

func Errorf(msg string, fields map[string]interface{})

Errorf logs an error message with fields

func Fatal

func Fatal(msg string)

Fatal logs a fatal message and exits

func Fatalf

func Fatalf(msg string, fields map[string]interface{})

Fatalf logs a fatal message with fields and exits

func Info

func Info(msg string)

Info logs an info message

func Infof

func Infof(msg string, fields map[string]interface{})

Infof logs an info message with fields

func LogError added in v1.2.0

func LogError(err error, msg string)

LogError logs an error with details This should be the preferred method for logging errors in the application

func LogErrorf added in v1.2.0

func LogErrorf(err error, msg string, fields map[string]interface{})

LogErrorf logs an error with details and fields

func LogFatal added in v1.2.0

func LogFatal(err error, msg string)

LogFatal logs a fatal error with details and exits

func SetLevel

func SetLevel(level zerolog.Level)

SetLevel sets the log level

func Warn

func Warn(msg string)

Warn logs a warning message

func Warnf

func Warnf(msg string, fields map[string]interface{})

Warnf logs a warning message with fields

func WithContext

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

WithContext returns a logger with additional context This is useful for adding persistent fields to log messages in a specific component or function chain

Types

This section is empty.

Jump to

Keyboard shortcuts

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