Documentation
¶
Index ¶
- Constants
- func ClearDebugToggleSignal()
- func Configure(cfg *cfgapi.Config) error
- func Debug(format string, args ...interface{})
- func DebugBlock(prefix string, format string, args ...interface{})
- func DebugEnabled(source string) bool
- func DisableDebug(source string) bool
- func EnableDebug(source string) bool
- func Error(format string, args ...interface{})
- func ErrorBlock(prefix string, format string, args ...interface{})
- func Every(interval time.Duration) goxrate.Limit
- func Fatal(format string, args ...interface{})
- func Flush()
- func Info(format string, args ...interface{})
- func InfoBlock(prefix string, format string, args ...interface{})
- func Panic(format string, args ...interface{})
- func SetLevel(level Level)
- func SetStdLogger(source string)
- func SetupDebugToggleSignal(sig os.Signal)
- func Warn(format string, args ...interface{})
- func WarnBlock(prefix string, format string, args ...interface{})
- type Level
- type Logger
- type Rate
Constants ¶
const ( // DefaultWindow is the default message window size for rate limiting. DefaultWindow = 256 // MinimumWindow is the smallest message window size for rate limiting. MinimumWindow = 32 )
const ( // DefaultLevel is the default logging severity level. DefaultLevel = LevelInfo )
Variables ¶
This section is empty.
Functions ¶
func ClearDebugToggleSignal ¶
func ClearDebugToggleSignal()
ClearDebugToggleSignal removes any signal handlers for toggling debug on/off.
func Debug ¶
func Debug(format string, args ...interface{})
Debug formats and emits a debug message.
func DebugBlock ¶
DebugBlock formats and emits a multiline debug message.
func DebugEnabled ¶
DebugEnabled checks if debug logging is enabled for the source.
func DisableDebug ¶
DisableDebug disables debug logging for the source.
func EnableDebug ¶
EnableDebug enables debug logging for the source.
func Error ¶
func Error(format string, args ...interface{})
Error formats and emits an error message.
func ErrorBlock ¶
ErrorBlock formats and emits a multiline error message.
func Fatal ¶
func Fatal(format string, args ...interface{})
Fatal formats and emits an error message and os.Exit()'s with status 1.
func Info ¶
func Info(format string, args ...interface{})
Info formats and emits an informational message.
func Panic ¶
func Panic(format string, args ...interface{})
Panic formats and emits an error messages, and panics with the same.
func SetStdLogger ¶
func SetStdLogger(source string)
SetStdLogger sets up a logger for the standard log package.
func SetupDebugToggleSignal ¶
SetupDebugToggleSignal sets up a signal handler to toggle full debugging on/off.
Types ¶
type Level ¶
type Level int
Level describes the severity of a log message.
const ( // LevelDebug is the severity for debug messages. LevelDebug Level // LevelInfo is the severity for informational messages. LevelInfo // LevelWarn is the severity for warnings. LevelWarn // LevelError is the severity for errors. LevelError // LevelPanic is the severity for panic messages. LevelPanic // LevelFatal is the severity for fatal errors. LevelFatal )
type Logger ¶
type Logger interface {
// Standardized Logger interface functions so that this interface can be
// used from goresctrl library.
Debugf(format string, v ...interface{})
Infof(format string, v ...interface{})
Warnf(format string, v ...interface{})
Errorf(format string, v ...interface{})
Panicf(format string, v ...interface{})
Fatalf(format string, v ...interface{})
// Debug formats and emits a debug message.
Debug(format string, args ...interface{})
// Info formats and emits an informational message.
Info(format string, args ...interface{})
// Warn formats and emits a warning message.
Warn(format string, args ...interface{})
// Error formats and emits an error message.
Error(format string, args ...interface{})
// Panic formats and emits an error message then panics with the same.
Panic(format string, args ...interface{})
// Fatal formats and emits an error message and os.Exit()'s with status 1.
Fatal(format string, args ...interface{})
// Println to mimic minimal stdlin log.Logger interface.
Println(v ...any)
// DebugBlock formats and emits a multiline debug message.
DebugBlock(prefix string, format string, args ...interface{})
// InfoBlock formats and emits a multiline information message.
InfoBlock(prefix string, format string, args ...interface{})
// WarnBlock formats and emits a multiline warning message.
WarnBlock(prefix string, format string, args ...interface{})
// ErrorBlock formats and emits a multiline error message.
ErrorBlock(prefix string, format string, args ...interface{})
// EnableDebug enables debug messages for this Logger.
EnableDebug(bool) bool
// DebugEnabled checks if debug messages are enabled for this Logger.
DebugEnabled() bool
// Source returns the source name of this Logger.
Source() string
}
Logger is the interface for producing log messages for/from a particular source.