Documentation
¶
Index ¶
- Variables
- func SetLogLevel(name string)
- type LogInfo
- type LogType
- type Logger
- func (l *Logger) ActivityLog(message string, info LogInfo)
- func (l *Logger) ErrorLog(message string, err error, info LogInfo)
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Log(logType LogType, message string, info LogInfo)
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetColorFormatter(color bool)
- func (l *Logger) SetJSONFormatter(json bool)
- func (l *Logger) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var AllLogType = map[LogType]string{ DEBUG: "debug", INFO: "info", WARN: "warn", ERROR: "error", FATAL: "fatal", }
AllLogType is a map of LogType to string names
Functions ¶
func SetLogLevel ¶
func SetLogLevel(name string)
SetLogLevel sets the minimum log level for messages
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger a logrus implementer of the JSON logger interface
func NewBasicLogrusLogger ¶
NewBasicLogrusLogger creates a logrus logger with a context but no other options
func NewColorLogrusLogger ¶
NewColorLogrusLogger creates a logrus logger with a context and colorized output support
func NewLogrusLogger ¶
NewLogrusLogger return a LogrusLogger
func NoOpLogger ¶
NoOpLogger creates a no-op logger for testing purposes.
func (*Logger) ActivityLog ¶
ActivityLog is used for web activity logs
func (*Logger) Println ¶
func (l *Logger) Println(v ...interface{})
Println allows Println'ing on the logger
func (*Logger) SetColorFormatter ¶
SetColorFormatter sets logger to show colors on Unix and Windows systems
func (*Logger) SetJSONFormatter ¶
SetJSONFormatter sets logger to emit JSON or false => TextFormatter
Click to show internal directories.
Click to hide internal directories.