Documentation ¶
Overview ¶
The Logger of the Go Application Support provides a flexible way to log information with different levels and on different backends.
Index ¶
- func Criticalf(format string, args ...interface{})
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func SetLevel(level LogLevel)
- func SetLogger(l Logger)
- func Warningf(format string, args ...interface{})
- type GoLogger
- type LogLevel
- type Logger
- type StandardLogger
- type SysLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GoLogger ¶
type GoLogger struct{}
GoLogger just uses the standard go log package.
type LogLevel ¶
type LogLevel int
LogLevel describes the chosen log level between debug and critical.
Log levels to control the logging output.
type Logger ¶
type Logger interface { // Debug logs a message at debug level. Debug(info, msg string) // Info logs a message at info level. Info(info, msg string) // Warning logs a message at warning level. Warning(info, msg string) // Error logs a message at error level. Error(info, msg string) // Critical logs a message at critical level. Critical(info, msg string) }
Logger is the interface for different logger backends.
func NewGoLogger ¶
func NewGoLogger() Logger
NewGoLogger returns a logger implementation using the Go log package.
func NewStandardLogger ¶
NewStandardLogger creates the standard logger.
func NewSysLogger ¶
NewGoLogger returns a logger implementation using the Go syslog package.
type StandardLogger ¶
type StandardLogger struct {
// contains filtered or unexported fields
}
StandardLogger is a simple logger writing to the given writer. It doesn't handle the levels differently.
func (*StandardLogger) Critical ¶
func (sl *StandardLogger) Critical(info, msg string)
Critical logs a message at critical level.
func (*StandardLogger) Debug ¶
func (sl *StandardLogger) Debug(info, msg string)
Debug logs a message at debug level.
func (*StandardLogger) Error ¶
func (sl *StandardLogger) Error(info, msg string)
Error logs a message at error level.
func (*StandardLogger) Info ¶
func (sl *StandardLogger) Info(info, msg string)
Info logs a message at info level.
func (*StandardLogger) Warning ¶
func (sl *StandardLogger) Warning(info, msg string)
Warning logs a message at warning level.
type SysLogger ¶
type SysLogger struct {
// contains filtered or unexported fields
}
SysLogger