Documentation
¶
Overview ¶
Package log implements logging for the datadog agent. It wraps seelog, and supports logging to multiple destinations, buffering messages logged before setup, and scrubbing secrets from log messages.
Compatibility ¶
This module is exported and can be used outside of the datadog-agent repository, but is not designed as a general-purpose logging system. Its API may change incompatibly.
Index ¶
- func ChangeLogLevel(l seelog.LoggerInterface, level string) error
- func Critical(v ...interface{}) error
- func CriticalStackDepth(depth int, v ...interface{}) error
- func Criticalc(message string, context ...interface{}) error
- func CriticalcStackDepth(message string, depth int, context ...interface{}) error
- func Criticalf(format string, params ...interface{}) error
- func Debug(v ...interface{})
- func DebugStackDepth(depth int, v ...interface{})
- func Debugc(message string, context ...interface{})
- func DebugcStackDepth(message string, depth int, context ...interface{})
- func Debugf(format string, params ...interface{})
- func Error(v ...interface{}) error
- func ErrorStackDepth(depth int, v ...interface{}) error
- func Errorc(message string, context ...interface{}) error
- func ErrorcStackDepth(message string, depth int, context ...interface{}) error
- func Errorf(format string, params ...interface{}) error
- func Flush()
- func GetLogLevel() (seelog.LogLevel, error)
- func Info(v ...interface{})
- func InfoStackDepth(depth int, v ...interface{})
- func Infoc(message string, context ...interface{})
- func InfocStackDepth(message string, depth int, context ...interface{})
- func Infof(format string, params ...interface{})
- func JMXError(v ...interface{}) error
- func JMXInfo(v ...interface{})
- func RegisterAdditionalLogger(n string, l seelog.LoggerInterface) error
- func ReplaceLogger(l seelog.LoggerInterface) seelog.LoggerInterface
- func SetupJMXLogger(i seelog.LoggerInterface, level string)
- func SetupLogger(i seelog.LoggerInterface, level string)
- func ShouldLog(lvl seelog.LogLevel) bool
- func Trace(v ...interface{})
- func TraceStackDepth(depth int, v ...interface{})
- func Tracec(message string, context ...interface{})
- func TracecStackDepth(message string, depth int, context ...interface{})
- func Tracef(format string, params ...interface{})
- func UnregisterAdditionalLogger(n string) error
- func Warn(v ...interface{}) error
- func WarnStackDepth(depth int, v ...interface{}) error
- func Warnc(message string, context ...interface{}) error
- func WarncStackDepth(message string, depth int, context ...interface{}) error
- func Warnf(format string, params ...interface{}) error
- type DatadogLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeLogLevel ¶
func ChangeLogLevel(l seelog.LoggerInterface, level string) error
ChangeLogLevel changes the current log level, valide levels are trace, debug, info, warn, error, critical and off, it requires a new seelog logger because an existing one cannot be updated
func Critical ¶
func Critical(v ...interface{}) error
Critical logs at the critical level and returns an error containing the formated log message
func CriticalStackDepth ¶
CriticalStackDepth logs at the critical level and the current stack depth plus the additional given one and returns an error containing the formated log message
func Criticalc ¶ added in v0.30.0
Criticalc logs at the critical level with context and returns an error containing the formated log message
func CriticalcStackDepth ¶ added in v0.32.0
CriticalcStackDepth logs at the critical level with context and the current stack depth plus the additional given one and returns an error containing the formated log message
func Criticalf ¶
Criticalf logs with format at the critical level and returns an error containing the formated log message
func DebugStackDepth ¶ added in v0.30.0
func DebugStackDepth(depth int, v ...interface{})
DebugStackDepth logs at the debug level and the current stack depth plus the additional given one and returns an error containing the formated log message
func Debugc ¶
func Debugc(message string, context ...interface{})
Debugc logs at the debug level with context
func DebugcStackDepth ¶ added in v0.32.0
DebugcStackDepth logs at the debug level with context and the current stack depth plus the additional given one
func Debugf ¶
func Debugf(format string, params ...interface{})
Debugf logs with format at the debug level
func Error ¶
func Error(v ...interface{}) error
Error logs at the error level and returns an error containing the formated log message
func ErrorStackDepth ¶
ErrorStackDepth logs at the error level and the current stack depth plus the additional given one and returns an error containing the formated log message
func Errorc ¶ added in v0.30.0
Errorc logs at the error level with context and returns an error containing the formated log message
func ErrorcStackDepth ¶ added in v0.32.0
ErrorcStackDepth logs at the error level with context and the current stack depth plus the additional given one and returns an error containing the formated log message
func Errorf ¶
Errorf logs with format at the error level and returns an error containing the formated log message
func GetLogLevel ¶
GetLogLevel returns a seelog native representation of the current log level
func InfoStackDepth ¶
func InfoStackDepth(depth int, v ...interface{})
InfoStackDepth logs at the info level and the current stack depth plus the additional given one
func Infoc ¶
func Infoc(message string, context ...interface{})
Infoc logs at the info level with context
func InfocStackDepth ¶ added in v0.32.0
InfocStackDepth logs at the info level with context and the current stack depth plus the additional given one
func Infof ¶
func Infof(format string, params ...interface{})
Infof logs with format at the info level
func RegisterAdditionalLogger ¶
func RegisterAdditionalLogger(n string, l seelog.LoggerInterface) error
RegisterAdditionalLogger registers an additional logger for logging
func ReplaceLogger ¶
func ReplaceLogger(l seelog.LoggerInterface) seelog.LoggerInterface
ReplaceLogger allows replacing the internal logger, returns old logger
func SetupJMXLogger ¶
func SetupJMXLogger(i seelog.LoggerInterface, level string)
SetupJMXLogger setup JMXfetch specific logger
func SetupLogger ¶
func SetupLogger(i seelog.LoggerInterface, level string)
SetupLogger setup agent wide logger
func ShouldLog ¶ added in v0.32.0
ShouldLog returns whether a given log level should be logged by the default logger
func TraceStackDepth ¶ added in v0.30.0
func TraceStackDepth(depth int, v ...interface{})
TraceStackDepth logs at the trace level and the current stack depth plus the additional given one and returns an error containing the formated log message
func Tracec ¶
func Tracec(message string, context ...interface{})
Tracec logs at the trace level with context
func TracecStackDepth ¶ added in v0.32.0
TracecStackDepth logs at the trace level with context and the current stack depth plus the additional given one
func Tracef ¶
func Tracef(format string, params ...interface{})
Tracef logs with format at the trace level
func UnregisterAdditionalLogger ¶
UnregisterAdditionalLogger unregisters additional logger with name n
func Warn ¶
func Warn(v ...interface{}) error
Warn logs at the warn level and returns an error containing the formated log message
func WarnStackDepth ¶
WarnStackDepth logs at the warn level and the current stack depth plus the additional given one and returns an error containing the formated log message
func Warnc ¶ added in v0.30.0
Warnc logs at the warn level with context and returns an error containing the formated log message
func WarncStackDepth ¶ added in v0.32.0
WarncStackDepth logs at the warn level with context and the current stack depth plus the additional given one and returns an error containing the formated log message
Types ¶
type DatadogLogger ¶
type DatadogLogger struct {
// contains filtered or unexported fields
}
DatadogLogger wrapper structure for seelog