Documentation ¶
Overview ¶
Package logger contains logger implementation
Index ¶
Constants ¶
View Source
const LoggerKey keyLogger = 0
LoggerKey is the key used to retrieve the logger value from the request context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { With(args ...any) Logger WithoutCaller() Logger Debug(args ...any) // Info uses fmt.Sprint to construct and log a message at INFO level Info(args ...any) // Error uses fmt.Sprint to construct and log a message at ERROR level Error(args ...any) // Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit. Fatal(args ...any) // Debugf uses fmt.Sprintf to construct and log a message at DEBUG level Debugf(format string, args ...any) // Infof uses fmt.Sprintf to construct and log a message at INFO level Infof(format string, args ...any) // Errorf uses fmt.Sprintf to construct and log a message at ERROR level Errorf(format string, args ...any) // Fatalf uses fmt.Sprintf to construct and log a message, then calls os.Exit. Fatalf(format string, args ...any) Warn(args ...any) }
Logger is an interface that describes all the capabilities of the application's logger.
func FromContext ¶
FromContext returns a logger from context. If none found, instantiate a new logger.
func NewTestLogger ¶
func NewTestLogger() (Logger, *observer.ObservedLogs)
NewTestLogger returns a test logger with observability capabilities.
Click to show internal directories.
Click to hide internal directories.