logger

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ComponentLogPrefix = "component"

ComponentLogPrefix is used by the logger to prefix log messages with the component name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a type that is used to hold metadata that should be used in the loggers methods.

func New

func New(prefix string, loggerImpl *zerolog.Logger) *Logger

New creates a new logger with the passed prefix and logger implementation. When loggerImpl is nil, the default logger of zerolog will be used.

func (*Logger) Debug

func (l *Logger) Debug(format string, v ...interface{})

Debug logs a message with level debug. This function appends the name of the Component from the receiver to the log message.

func (*Logger) Err

func (l *Logger) Err(err error, format string, v ...interface{})

Err logs a message with level error. This function appends the name of the Component from the receiver to the log message.

The supplied error will be applied to the log message.

func (*Logger) Info

func (l *Logger) Info(format string, v ...interface{})

Info logs a message with level info. This function appends the name of the Component from the receiver to the log message.

func (*Logger) Logger added in v0.1.0

func (l *Logger) Logger() *zerolog.Logger

Logger returns the real zerolog.Logger used by this logger implementation. Except for internal usage (e.g. internal or api packages), the wrapper functions should be used.

func (*Logger) Warn

func (l *Logger) Warn(format string, v ...interface{})

Warn logs a message with level warnings. This function appends the name of the Component from the receiver to the log message.

Jump to

Keyboard shortcuts

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