Documentation ¶
Index ¶
- Constants
- func Close()
- func Critical(msg string)
- func Criticalf(format string, params ...interface{})
- func Debug(msg string)
- func Debugf(format string, params ...interface{})
- func Error(msg string)
- func Errorf(format string, params ...interface{})
- func Fatal(msg string)
- func Fatalf(format string, params ...interface{})
- func Info(msg string)
- func Infof(format string, params ...interface{})
- func Panic(msg string)
- func Panicf(format string, params ...interface{})
- func RegisterLogger(minLogLevel, maxLogLevel LogLevel, log Logger)
- func SetLogLevel(level LogLevel)
- func Warning(msg string)
- func Warningf(format string, params ...interface{})
- type LogLevel
- type Logger
Constants ¶
const ( // Must be in sequential ascending order based on priority // (higher priorities have higher numeric values) LL_DEBUG = iota LL_INFO LL_WARNING LL_ERROR LL_CRITICAL LL_LOGLEVEL_SIZE LL_MIN_LEVEL = LL_DEBUG LL_MAX_LEVEL = LL_LOGLEVEL_SIZE - 1 )
Variables ¶
This section is empty.
Functions ¶
func Close ¶
func Close()
Close informs the configured loggers that they are being closed and should cleanup (for instance, flushing any queued log messages)
func Critical ¶
func Critical(msg string)
Critical sends a message to the logger object to record critical level statements (these indicate conditions that should never occur and might cause a failure/crash of the executing program or unexpected outcome from the requested action).
func Criticalf ¶
func Criticalf(format string, params ...interface{})
Criticalf formats a message before sending it to the logger object to record critical level statements (these indicate conditions that should never occur and might cause a failure/crash of the executing program or unexpected outcome from the requested action).
func Debug ¶
func Debug(msg string)
Debug sends a message to the logger object to record debug/trace level statements
func Debugf ¶
func Debugf(format string, params ...interface{})
Debugf formats a message before sending it to the logger object to record debug/trace level statements
func Error ¶
func Error(msg string)
Error sends a message to the logger object to record error level statements (these indicate conditions that should not occur and may indicate a failure in performing the requested action).
func Errorf ¶
func Errorf(format string, params ...interface{})
Errorf formats a message before sending it to the logger object to record error level statements (these indicate conditions that should not occur and may indicate a failure in performing the requested action).
func Fatal ¶
func Fatal(msg string)
Fatal sends a CRITICAL message to the logger object and then exits. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.
func Fatalf ¶
func Fatalf(format string, params ...interface{})
Fatalf sends a formatted CRITICAL message to the logger object and then exits. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.
func Info ¶
func Info(msg string)
Info sends a message to the logger object to record informational level statements (these should be statements that can normally be logged without causing performance issues).
func Infof ¶
func Infof(format string, params ...interface{})
Infof formats a message before sending it to the logger object to record informational level statements (there should be statements that can normally be logged without causing performance issues).
func Panic ¶
func Panic(msg string)
Panic sends a CRITICAL message to the logger object and then calls panic. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.
func Panicf ¶
func Panicf(format string, params ...interface{})
Panicf sends a formatted CRITICAL message to the logger object and then calls panic. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.
func RegisterLogger ¶
RegisterLogger must be called to map a concrete logger object with each log level.
func SetLogLevel ¶
func SetLogLevel(level LogLevel)
SetLogLevel sets the current package-level filtering
Types ¶
type LogLevel ¶
type LogLevel int
LogLevel is used for global (package-level) filtering of log messages based on their priority (this filtering is applied before all other filtering which might be provided by the concrete logger).
func GetLogLevel ¶
func GetLogLevel() LogLevel
GetLogLevel returns the current package-level filtering
func NewLogLevel ¶
NewLogLevel converts a string to a log level.
func (LogLevel) MarshalJSON ¶
MarshalJSON converts a LogLevel to a quoted string for JSON output.
func (*LogLevel) UnmarshalJSON ¶
type Logger ¶
type Logger interface { Debug(string) Debugf(string, ...interface{}) Info(string) Infof(string, ...interface{}) Warning(string) Warningf(string, ...interface{}) Error(string) Errorf(string, ...interface{}) Critical(string) Criticalf(string, ...interface{}) GetLogLevel() syslog.Priority SetLogLevel(syslog.Priority) Close() }
Generic interface that all concrete loggers must implement. Using this interface directly isolates user code from a particular logger implementation.