log

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: AGPL-3.0 Imports: 10 Imported by: 88

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 ...interface{})

Debug sends a debug level log message

func Debugf

func Debugf(template string, args ...interface{})

Debugf sends a formatted debug level log message

func Debugw

func Debugw(msg string, keyvalues ...interface{})

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

func Error

func Error(args ...interface{})

Error sends an error level log message

func Errorf

func Errorf(template string, args ...interface{})

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 ...interface{})

Fatal sends a fatal level log message

func Fatalf

func Fatalf(template string, args ...interface{})

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 ...interface{})

Info sends an info level log message

func Infof

func Infof(template string, args ...interface{})

Infof sends a formatted info level log message

func Infow

func Infow(msg string, keyvalues ...interface{})

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

func Init

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

Init initializes the logger. Output can be either "stdout/stderr/<filePath>". Log level can be "debug/info/warn/error". errorOutput is an optional filename which only receives Warning and Error messages.

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]interface{})

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 ...interface{})

Warn sends a warn level log message

func Warnf

func Warnf(template string, args ...interface{})

Warnf sends a formatted warn level log message

func Warnw

func Warnw(msg string, keyvalues ...interface{})

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