Documentation ¶
Index ¶
- func ComponentLevels() map[string]zerolog.Level
- func ConfigureDefaultLogging()
- func SetComponentLevel(component string, children bool, level zerolog.Level)
- type LeveledLogger
- type Logger
- func (l *Logger) Current() zerolog.Logger
- func (l *Logger) Debug() *zerolog.Event
- func (l *Logger) Err(err error) *zerolog.Event
- func (l *Logger) Error() *zerolog.Event
- func (l *Logger) Fatal() *zerolog.Event
- func (l *Logger) Info() *zerolog.Event
- func (l *Logger) Level(level zerolog.Level) *Logger
- func (l *Logger) Trace() *zerolog.Event
- func (l *Logger) Warn() *zerolog.Event
- func (l *Logger) With(with func(zerolog.Context) zerolog.Context) *Logger
- func (l *Logger) WithLevel(level zerolog.Level) *zerolog.Event
- func (l *Logger) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentLevels ¶
ComponentLevels returns a _copy_ of the currently configured component level map
func ConfigureDefaultLogging ¶
func ConfigureDefaultLogging()
func SetComponentLevel ¶
SetComponentLevel changes the log level for a given component. If children is true, it will also change the log level for any child components that have been customized (by deleting that customization so that they inherit the log level from their parent).
Types ¶
type LeveledLogger ¶
type LeveledLogger struct {
// contains filtered or unexported fields
}
LeveledLogger implements the interface of the same name from github.com/hashicorp/go-retryablehttp
func Leveled ¶
func Leveled(l *Logger) LeveledLogger
Leveled returns a LeveledLogger wrapper for the given Logger
func (LeveledLogger) Debug ¶
func (l LeveledLogger) Debug(msg string, keysAndValues ...interface{})
func (LeveledLogger) Error ¶
func (l LeveledLogger) Error(msg string, keysAndValues ...interface{})
func (LeveledLogger) Info ¶
func (l LeveledLogger) Info(msg string, keysAndValues ...interface{})
func (LeveledLogger) Warn ¶
func (l LeveledLogger) Warn(msg string, keysAndValues ...interface{})
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger exists to wrap a replaceable zerolog.Logger so levels can be changed dynamically
func GetLogger ¶
GetLogger creates a logger for the given component name. Hierarchies in components should be represented with `/` characters in their name.
func GetLoggerWith ¶
GetLoggerWith creates a logger for the given component name and custom context configuration function. Hierarchies in components should be represented with `/` characters in their name.