log

package module
v0.19.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

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

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

func CriticalStackDepth(depth int, v ...interface{}) error

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

func Criticalc(message string, context ...interface{}) error

Criticalc logs at the critical level with context and returns an error containing the formated log message

func CriticalcStackDepth

func CriticalcStackDepth(message string, depth int, context ...interface{}) error

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

func Criticalf(format string, params ...interface{}) error

Criticalf logs with format at the critical level and returns an error containing the formated log message

func Debug

func Debug(v ...interface{})

Debug logs at the debug level

func DebugStackDepth

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

func DebugcStackDepth(message string, depth int, context ...interface{})

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

func ErrorStackDepth(depth int, v ...interface{}) error

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

func Errorc(message string, context ...interface{}) error

Errorc logs at the error level with context and returns an error containing the formated log message

func ErrorcStackDepth

func ErrorcStackDepth(message string, depth int, context ...interface{}) error

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

func Errorf(format string, params ...interface{}) error

Errorf logs with format at the error level and returns an error containing the formated log message

func Flush

func Flush()

Flush flushes the underlying inner log

func GetLogLevel

func GetLogLevel() (seelog.LogLevel, error)

GetLogLevel returns a seelog native representation of the current log level

func Info

func Info(v ...interface{})

Info logs at the info 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

func InfocStackDepth(message string, depth int, context ...interface{})

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 JMXError

func JMXError(v ...interface{}) error

JMXError Logs for JMX check

func JMXInfo

func JMXInfo(v ...interface{})

JMXInfo Logs

func RegisterAdditionalLogger

func RegisterAdditionalLogger(n string, l seelog.LoggerInterface) error

RegisterAdditionalLogger registers an additional logger for logging

func ReplaceLogger

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

func ShouldLog(lvl seelog.LogLevel) bool

ShouldLog returns whether a given log level should be logged by the default logger

func Trace

func Trace(v ...interface{})

Trace logs at the trace level

func TraceStackDepth

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

func TracecStackDepth(message string, depth int, context ...interface{})

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

func UnregisterAdditionalLogger(n string) error

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

func WarnStackDepth(depth int, v ...interface{}) error

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

func Warnc(message string, context ...interface{}) error

Warnc logs at the warn level with context and returns an error containing the formated log message

func WarncStackDepth

func WarncStackDepth(message string, depth int, context ...interface{}) error

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

func Warnf

func Warnf(format string, params ...interface{}) error

Warnf logs with format at the warn level 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL