log

package
v0.52.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LevelFatal = Level(logrus.FatalLevel)
	LevelError = Level(logrus.ErrorLevel)
	LevelWarn  = Level(logrus.WarnLevel)
	LevelInfo  = Level(logrus.InfoLevel)
	LevelDebug = Level(logrus.DebugLevel)
	LevelTrace = Level(logrus.TraceLevel)
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Error

func Error(args ...interface{})

func Fatal added in v0.49.0

func Fatal(args ...interface{})

func Info

func Info(args ...interface{})

func IsGreaterOrEqualTo added in v0.51.0

func IsGreaterOrEqualTo(level Level) bool

IsGreaterOrEqualTo returns true if the caller's current log level is equal or greater than the provided level.

func NewContext

func NewContext(ctx context.Context, keyValuePairs ...interface{}) context.Context

func Redact added in v0.43.0

func Redact(msg string) string

Redact applies redaction to a single string

func SetDefaultLogger

func SetDefaultLogger(l *logrus.Logger)

func SetLevel

func SetLevel(l Level)

SetLevel sets the global log level used by the simple logger.

func SetLevelString

func SetLevelString(l string)

func SetLogLevels added in v0.45.0

func SetLogLevels(levels map[string]string)

SetLogLevels sets the log levels for specific paths in the codebase.

func SetLogSourceLine

func SetLogSourceLine(enabled bool)

func SetRedacting added in v0.43.0

func SetRedacting(enabled bool)

func ShortDur

func ShortDur(d time.Duration) string

func Trace

func Trace(args ...interface{})

func Warn

func Warn(args ...interface{})

Types

type Hook added in v0.43.0

type Hook struct {
	// Messages with a log level not contained in this array
	// will not be dispatched. If empty, all messages will be dispatched.
	AcceptedLevels []logrus.Level
	RedactionList  []string
	// contains filtered or unexported fields
}

Hook is a logrus hook for redacting information from logs

func (*Hook) Fire added in v0.43.0

func (h *Hook) Fire(e *logrus.Entry) error

Fire redacts values in a log Entry that match with keys defined in the RedactionList

func (*Hook) Levels added in v0.43.0

func (h *Hook) Levels() []logrus.Level

Levels returns the user defined AcceptedLevels If AcceptedLevels is empty, all logrus levels are returned

type Level

type Level uint8

func CurrentLevel

func CurrentLevel() Level

type LevelFunc

type LevelFunc = func(ctx interface{}, msg interface{}, keyValuePairs ...interface{})

Jump to

Keyboard shortcuts

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