Documentation ¶
Overview ¶
Package xlog defines a standard logger for the application.
It uses structured logging thanks to https://github.com/sirupsen/logrus.
All messages have at least two fields:
A "trace" field which helps to identify messages belonging to the same context.
An "op" field which helps to identify the logical operation associated with the message.
Index ¶
- func Levels() []string
- type Level
- type Logger
- func (l Logger) DebugOp(op, message string)
- func (l Logger) DebugOpf(op, format string, args ...interface{})
- func (l Logger) ErrorOp(op string, err error)
- func (l Logger) ErrorOpf(op, format string, args ...interface{})
- func (l Logger) FatalOp(op string, err error)
- func (l Logger) InfoOp(op, message string)
- func (l Logger) InfoOpf(op, format string, args ...interface{})
- func (l Logger) Level() Level
- func (l Logger) WithFields(fields map[string]interface{}) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Level ¶
type Level string
Level helps setting the severity of the messages displayed.
func MustParseLevel ¶
MustParseLevel returns the Level corresponding to given string.
It panics if no correspondence.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger enforces specific log message formats.
func (Logger) WithFields ¶
WithFields returns a new xlog.Logger with given fields.
Click to show internal directories.
Click to hide internal directories.