Documentation ¶
Index ¶
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func InitDefaultLogger(opts ...LoggerOption)
- func Warnf(format string, args ...interface{})
- type Format
- type Level
- type Logger
- type LoggerOption
- type LoggerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitDefaultLogger ¶
func InitDefaultLogger(opts ...LoggerOption)
Types ¶
type Level ¶
type Level uint32
Level represents the logging level.
const ( // Usually only enabled when debugging. Very verbose logging. LevelDebug Level = iota // General operational entries about what's going on inside the application. LevelInfo // Non-critical events that should be looked at. LevelWarn // Critical events that require immediate attention. LevelError )
type Logger ¶
type Logger interface { // Debug logs a Debug event. Debugf(format string, args ...interface{}) // Info logs an Info event. Infof(format string, args ...interface{}) // Warn logs a Warn(ing) event. Warnf(format string, args ...interface{}) // Error logs an Error event. Errorf(format string, args ...interface{}) }
Logger is a unified interface for logging.
func NewLogrusLogger ¶
func NewLogrusLogger(options ...LoggerOption) Logger
type LoggerOption ¶
type LoggerOption func(*LoggerOptions)
LoggerOption sets an optional parameter for loggers.
func WithLevel ¶
func WithLevel(level Level) LoggerOption
WithLevel sets the logger verbosity level.
type LoggerOptions ¶
type LoggerOptions struct { // Out specifies the output data stream. Out io.Writer // Level specifies the logging level the logger should log at. This is // typically (and defaults to) `Info`, which allows Info(), Warn() and // Error() to be logged. Level Level // Format specifies the logging format the logger should log at. Format Format }
Click to show internal directories.
Click to hide internal directories.