Documentation ¶
Overview ¶
Package flog contains logging-related APIs.
Index ¶
- type Formatter
- type Level
- type Log
- type Logger
- type Logrus
- func (l *Logrus) Debugf(format string, args ...interface{})
- func (l *Logrus) Debugln(args ...interface{})
- func (l *Logrus) Error(args ...interface{})
- func (l *Logrus) Errorf(format string, args ...interface{})
- func (l *Logrus) Fatal(args ...interface{})
- func (l *Logrus) Info(args ...interface{})
- func (l *Logrus) Infof(format string, args ...interface{})
- func (l *Logrus) Infoln(args ...interface{})
- func (l *Logrus) SetFormatter(formatter Formatter)
- func (l *Logrus) SetLevel(level Level)
- func (l *Logrus) Warnf(format string, args ...interface{})
- func (l *Logrus) Warnln(args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶ added in v1.1.0
type Formatter int
Formatter denotes a log formatter. Check the constants below for more information.
type Level ¶
type Level int
Level denotes a log level. Check the constants below for more information.
type Log ¶ added in v1.1.0
type Log struct { Level string `json:"level,omitempty"` Message string `json:"msg,omitempty"` Time string `json:"time,omitempty"` }
Log defines the properties of every log message.
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Debugln(args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Infoln(args ...interface{}) Warnln(args ...interface{}) Warnf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) SetLevel(level Level) SetFormatter(formatter Formatter) }
Logger should be used to write any logs. No concrete implementations should be directly used.
type Logrus ¶
type Logrus struct{}
Logrus implements the Logger interface.
func (*Logrus) Debugln ¶
func (l *Logrus) Debugln(args ...interface{})
Debugln logs a message at level Debug.
func (*Logrus) Error ¶
func (l *Logrus) Error(args ...interface{})
Error logs a message at level Error.
func (*Logrus) Fatal ¶
func (l *Logrus) Fatal(args ...interface{})
Fatal logs a message at level Fatal.
func (*Logrus) Infoln ¶
func (l *Logrus) Infoln(args ...interface{})
Infoln logs a message at level Info.
func (*Logrus) SetFormatter ¶ added in v1.1.0
SetFormatter sets the formatter of the logger.
Click to show internal directories.
Click to hide internal directories.