Documentation
¶
Index ¶
- Constants
- func InitLogging(id string, color bool, loggers []*LoggerConfig) (err error)
- type Backend
- type Logger
- func (l *Logger) Critical(args ...interface{})
- func (l *Logger) Criticalf(format string, args ...interface{})
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Notice(args ...interface{})
- func (l *Logger) Noticef(format string, args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Warning(args ...interface{})
- func (l *Logger) Warningf(format string, args ...interface{})
- func (l *Logger) Write(p []byte) (n int, err error)
- type LoggerConfig
Constants ¶
const ( CRITICAL level = iota ERROR WARNING NOTICE INFO DEBUG )
Logging levels
Variables ¶
This section is empty.
Functions ¶
func InitLogging ¶ added in v0.16.0
func InitLogging(id string, color bool, loggers []*LoggerConfig) (err error)
InitLogging initializes logging system with an identifier for the log messages, whether the output should be in colored mode and a set of logger configs.
Types ¶
type Backend ¶ added in v0.20.1
type Backend interface {
Core(msgPriority zap.LevelEnablerFunc, encoder zapcore.Encoder) zapcore.Core
}
Backend describes a logging backend
func NewFileBackend ¶ added in v0.20.1
NewFileBackend returns a logging backend that outputs to a file
func NewStdioBackend ¶ added in v0.20.1
NewStdioBackend returns a logging backend that outputs to the standard output
type Logger ¶ added in v0.16.0
Logger describes an identifier logger
func (*Logger) Critical ¶ added in v0.16.0
func (l *Logger) Critical(args ...interface{})
Critical logs a message using CRITICAL as log level.
func (*Logger) Criticalf ¶ added in v0.16.0
Criticalf logs a message using CRITICAL as log level.
func (*Logger) Debug ¶ added in v0.16.0
func (l *Logger) Debug(args ...interface{})
Debug logs a message using DEBUG as log level.
func (*Logger) Debugf ¶ added in v0.16.0
Debugf logs a message using DEBUG as log level.
func (*Logger) Error ¶ added in v0.16.0
func (l *Logger) Error(args ...interface{})
Error logs a message using ERROR as log level.
func (*Logger) Errorf ¶ added in v0.16.0
Errorf logs a message using ERROR as log level.
func (*Logger) Fatal ¶ added in v0.16.0
func (l *Logger) Fatal(args ...interface{})
Fatal is equivalent to l.Critical(fmt.Sprint()) followed by a call to os.Exit(1).
func (*Logger) Fatalf ¶ added in v0.16.0
Fatalf is equivalent to l.Critical followed by a call to os.Exit(1).
func (*Logger) Info ¶ added in v0.16.0
func (l *Logger) Info(args ...interface{})
Info logs a message using INFO as log level.
func (*Logger) Infof ¶ added in v0.16.0
Infof logs a message using INFO as log level.
func (*Logger) Notice ¶ added in v0.16.0
func (l *Logger) Notice(args ...interface{})
Notice logs a message using NOTICE as log level.
func (*Logger) Noticef ¶ added in v0.16.0
Noticef logs a message using NOTICE as log level.
func (*Logger) Panic ¶ added in v0.16.0
func (l *Logger) Panic(args ...interface{})
Panic is equivalent to l.Critical(fmt.Sprint()) followed by a call to panic().
func (*Logger) Panicf ¶ added in v0.16.0
Panicf is equivalent to l.Critical followed by a call to panic().
func (*Logger) Warning ¶ added in v0.16.0
func (l *Logger) Warning(args ...interface{})
Warning logs a message using WARNING as log level.
func (*Logger) Warningf ¶ added in v0.16.0
Warningf logs a message using WARNING as log level.
type LoggerConfig ¶ added in v0.22.0
type LoggerConfig struct {
// contains filtered or unexported fields
}
LoggerConfig describes a logger configuration such as backend, log level or an encoding
func NewLoggerConfig ¶ added in v0.22.0
func NewLoggerConfig(backend Backend, logLevel string, encoding string) *LoggerConfig
NewLoggerConfig returns a logger configuration with the associated logging backend, log level and encoding
Source Files
¶
- logging.go
- syslog.go