slog

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

Debug logs a line with level debug.

func Debugf

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

Debugf logs a format line with level debug.

func Error

func Error(err error, msg string, args ...any)

Error logs a line with level error. If err is not nil it adds only the msg string or vice-versa. Otherwise adds both.

func Errorf

func Errorf(err error, format string, args ...any)

Errorf logs a format line with level error. If err is not nil it adds only the msg string or vice-versa. Otherwise adds both.

func GetLogger

func GetLogger() log.Logger

GetLogger returns the default instance of logfmt logger

func Info

func Info(msg string, args ...any)

Info logs a line with level Info.

func Infof

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

Infof logs a format line with level info.

func Warn

func Warn(msg string, args ...any)

Warn logs a line with level warn.

func Warnf

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

Warnf logs a format line with level warn.

func WithFields

func WithFields(fields map[string]any) *loggerWrapper

WithFields returns WithFields using the defaultLoggerWrapper.

func WithTraceId

func WithTraceId(ctx context.Context) *loggerWrapper

WithTraceId returns WithTraceId using the defaultLoggerWrapper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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