Documentation ¶
Overview ¶
Package logger defines the logging utilities for the signare.
nolint: loggercheck
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLogger ¶
func RegisterLogger(options Options)
RegisterLogger for the application with the provided options.
Types ¶
type Logger ¶
type Logger interface { // WithArguments injects extra arguments to the log entry WithArguments(args ...any) Logger // Info creates a log entry with LevelInfo Info(msg string) // Infof creates a formatted log entry with LevelInfo Infof(format string, args ...any) // Debug creates a log entry with LevelDebug Debug(msg string) // Debugf creates a formatted log entry with LevelDebug Debugf(format string, args ...any) // Warn creates a log entry with LevelWarn Warn(msg string) // Warnf creates a formatted log entry with LevelWarn Warnf(format string, args ...any) // Error creates a log entry with LevelError Error(msg string) // Errorf creates a formatted log entry with LevelError Errorf(format string, args ...interface{}) }
Logger defines the functionality to log with different levels in the application.
type Options ¶
type Options struct { // Level the log level Level *Level // LogOutput where the logs are written to LogOutput io.Writer // CtxKeysRegistry defines which keys from the context, if present, will be logged as a default attribute. CtxKeysRegistry map[entities.ContextKey]LogKey }
Options configures a Logger.
type Tracer ¶
type Tracer interface { // AddProperty allows the inclusion of permanent properties to the Tracer's namespace object. AddProperty(key string, value any) // Trace creates a log entry with LevelInfo containing the tracer's object. Trace(msg string) // TraceWithData creates a log entry with LevelInfo containing the tracer's object. // The data arguments are placed inside the tracer's namespace object. TraceWithData(msg string, data map[string]any) // Warn creates a log entry with LevelWarn containing the tracer's object. Warn(msg string) // WarnWithData creates a log entry with LevelWarn containing the tracer's object. // The data arguments are placed inside the tracer's namespace object. WarnWithData(msg string, data map[string]any) // Error creates a log entry with LevelError containing the tracer's object. // The message is placed outside the tracer's namespace object. Error(msg string) // Errorf creates a log entry with LevelError containing the tracer's object, // formatting the message using a format string and arguments provided. Errorf(format string, data ...interface{}) // ErrorWithData creates a log entry with LevelError containing the tracer's object. // The message is placed outside the tracer's namespace object, while the data arguments are placed inside of it. ErrorWithData(msg string, data map[string]any) // Debug creates a log entry with LevelDebug containing the tracer's object. Debug(msg string) // Debugf creates a log entry with LevelDebug containing the tracer's object, // formatting the message using a format string and arguments provided. Debugf(format string, data ...interface{}) // DebugWithData creates a log entry with LevelDebug containing the tracer's object. // The data arguments are placed inside the tracer's namespace object. DebugWithData(msg string, data map[string]any) }
Tracer represents a logger with tracing capabilities. It allows the creation of a scoped tracing object with a specific namespace.
Click to show internal directories.
Click to hide internal directories.