Documentation
¶
Overview ¶
The package log provides an abstraction above a specific logger implementation.
Index ¶
Constants ¶
View Source
const ( DebugLevel = Level(zap.DebugLevel) InfoLevel = Level(zap.InfoLevel) WarnLevel = Level(zap.WarnLevel) ErrorLevel = Level(zap.ErrorLevel) OutputConsole OutputFormat = "console" OutputJSON OutputFormat = "json" )
Variables ¶
View Source
var ( ErrInvalidLevelValue = errors.New("invalid_level_value") ErrInvalidFormatValue = errors.New("invalid_format_value") )
Functions ¶
This section is empty.
Types ¶
type ConfigurableLogger ¶ added in v1.2.0
type ConfigurableLogger interface {
Logger
Configure(OutputFormat, Level) error // Configure the logger output format and level.
}
Configurable logger to define additional settings.
type Level ¶ added in v1.2.0
type Level int8 // Log level used by the logger.
func ParseLevel ¶ added in v1.2.0
Try to parse the given raw level string into a valid log.Level.
type Logger ¶
type Logger interface {
Error(args ...any)
Errorw(msg string, keysAndValues ...any)
Debug(args ...any)
Debugw(msg string, keysAndValues ...any)
Info(args ...any)
Infow(msg string, keysAndValues ...any)
Warn(args ...any)
Warnw(msg string, keysAndValues ...any)
}
Logger used to log things out
type OutputFormat ¶ added in v1.2.0
type OutputFormat string // Output format used by the logger.
func ParseFormat ¶ added in v1.2.0
func ParseFormat(format string) (OutputFormat, error)
Try to parse the given raw format string into a valid log.OutputFormat.
Click to show internal directories.
Click to hide internal directories.