Documentation ¶
Index ¶
- Variables
- func Debug(a ...interface{})
- func Error(a ...interface{})
- func Fatal(a ...interface{})
- func Info(a ...interface{})
- func SetFormatter(formatter Formatter)
- func SetHandler(handler Handler)
- func SetLevel(level int)
- func SetTimeFormatter(format string)
- func Warn(a ...interface{})
- type ConsoleHandler
- type FileHandler
- type Formatter
- type Handler
- type Logger
- func (l Logger) Check() bool
- func (l Logger) Compile(a ...interface{}) string
- func (l Logger) Debug(a ...interface{})
- func (l Logger) Error(a ...interface{})
- func (l Logger) Fatal(a ...interface{})
- func (l Logger) Info(a ...interface{})
- func (l *Logger) SetFormatter(formatter Formatter)
- func (l *Logger) SetHandler(handler Handler)
- func (l *Logger) SetLevel(level int)
- func (l *Logger) SetLogEnv(env string)
- func (l *Logger) SetTimeFormatter(format string)
- func (l Logger) Warn(a ...interface{})
- type StandardFormatter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DEBUG level of DEBUG DEBUG = 1 // INFO level of DEBUG INFO = 2 // WARN level of DEBUG WARN = 3 // ERROR level of DEBUG ERROR = 4 )
Functions ¶
func SetTimeFormatter ¶ added in v0.2.2
func SetTimeFormatter(format string)
SetTimeFormatter set the time format string of logger
Types ¶
type FileHandler ¶
type FileHandler struct { Handler // contains filtered or unexported fields }
FileHandler output logs to console
type Formatter ¶
type Formatter interface {
// contains filtered or unexported methods
}
Formatter format the message
type Handler ¶
type Handler interface {
// contains filtered or unexported methods
}
Handler handle the output process
func NewConsoleHandler ¶
func NewConsoleHandler() Handler
NewConsoleHandler return ConsoleHandler instance
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a instance to handle logs
func (Logger) Fatal ¶
func (l Logger) Fatal(a ...interface{})
Fatal output level ERROR log and exit with code 1
func (*Logger) SetFormatter ¶
SetFormatter set the formatter of logger
func (*Logger) SetHandler ¶
SetHandler set the handler of logger
func (*Logger) SetTimeFormatter ¶
SetTimeFormatter set the time format string of logger
type StandardFormatter ¶
type StandardFormatter struct {
Formatter
}
StandardFormatter default formatter
Click to show internal directories.
Click to hide internal directories.