Documentation
¶
Index ¶
- Variables
- func AddLogger(l *Logger)
- func Caller(skip int) caller
- func Critical(a ...interface{})
- func Criticalf(format string, a ...interface{})
- func Debug(a ...interface{})
- func Debugf(format string, a ...interface{})
- func Error(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Fatal(a ...interface{})
- func Fatalf(format string, a ...interface{})
- func Import() struct{}
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func Warning(a ...interface{})
- func Warningf(format string, a ...interface{})
- type Level
- type Logger
- type LoggerFunc
- type MarshalFunc
- type Message
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TimeFormat is the Default Time Format TimeFormat = "2006-01-02 15:04:05.000" Stack Level = LevelError Loggers = []*Logger{} CallerStrLen = 35 )
View Source
var DefaultLogger = &Logger{ Stdout: os.Stdout, Stderr: os.Stderr, Level: LevelDebug, DefaultLevel: LevelDebug, Color: true, }
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
Stdout io.Writer
Stderr io.Writer
Level Level
DefaultLevel Level
Color bool
Marshal MarshalFunc
LogFunc LoggerFunc
}
func (*Logger) DefaultLogFunc ¶
type LoggerFunc ¶
type MarshalFunc ¶
type Message ¶
type Message struct {
Service string `json:"service"`
Level Level `json:"level"`
LevelString string `json:"levelString"`
Time time.Time `json:"time"`
Caller string `json:"caller"`
Stack string `json:"stack,omitempty"`
Text string `json:"text"`
Fields map[string]interface{} `json:"fields,omitempty"`
// contains filtered or unexported fields
}
func NewMessage ¶
Click to show internal directories.
Click to hide internal directories.