log

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: AGPL-3.0 Imports: 11 Imported by: 76

Documentation

Index

Constants

View Source
const (
	LogLevelDebug = "debug"
	LogLevelInfo  = "info"
	LogLevelWarn  = "warn"
	LogLevelError = "error"
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...any)

Debug sends a debug level log message

func Debugf

func Debugf(template string, args ...any)

Debugf sends a formatted debug level log message

func Debugw

func Debugw(msg string, keyvalues ...any)

Debugw sends a debug level log message with key-value pairs.

func Error

func Error(args ...any)

Error sends an error level log message

func Errorf

func Errorf(template string, args ...any)

Errorf sends a formatted error level log message

func Errorw

func Errorw(err error, msg string)

Errorw sends an error level log message with a special format for errors.

func Fatal

func Fatal(args ...any)

Fatal sends a fatal level log message

func Fatalf

func Fatalf(template string, args ...any)

Fatalf sends a formatted fatal level log message

func FormatProto

func FormatProto(arg protoreflect.ProtoMessage) string

func GooseLogger added in v1.9.0

func GooseLogger() *gooseLogger

GooseLogger provides access to a goose compatible logger, hardcoded to log messages as Debug level

func Info

func Info(args ...any)

Info sends an info level log message

func Infof

func Infof(template string, args ...any)

Infof sends a formatted info level log message

func Infow

func Infow(msg string, keyvalues ...any)

Infow sends an info level log message with key-value pairs.

func Init

func Init(level, output string, errorOutput io.Writer)

func Level added in v1.8.0

func Level() string

Level returns the current log level

func Logger

func Logger() *zerolog.Logger

Logger provides access to the global logger (zerolog).

func Monitor added in v1.4.0

func Monitor(msg string, args map[string]any)

Monitor is a wrapper around Info that allows passing a map of key-value pairs. This is useful for structured logging and monitoring. The caller information is skipped.

func Warn

func Warn(args ...any)

Warn sends a warn level log message

func Warnf

func Warnf(template string, args ...any)

Warnf sends a formatted warn level log message

func Warnw

func Warnw(msg string, keyvalues ...any)

Warnw sends a warning level log message with key-value pairs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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