Documentation
¶
Index ¶
- Constants
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Fatal(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func SetDefault(log Logger)
- func SetFormatter(f Formatter)
- func SetLevel(v uint32)
- func SetOutput(out io.Writer)
- func Warn(format string, args ...interface{})
- type FormatJSON
- type FormatString
- type Formatter
- type Log
- func (l *Log) Debug(message string, args ...interface{})
- func (l *Log) Error(message string, args ...interface{})
- func (l *Log) Fatal(message string, args ...interface{})
- func (l *Log) GetLevel() uint32
- func (l *Log) Info(message string, args ...interface{})
- func (l *Log) SetFormatter(f Formatter)
- func (l *Log) SetLevel(v uint32)
- func (l *Log) SetOutput(out io.Writer)
- func (l *Log) Warn(message string, args ...interface{})
- type Logger
- type Message
Constants ¶
View Source
const ( LevelError uint32 LevelWarn LevelInfo LevelDebug )
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶ added in v0.4.1
func SetDefault(log Logger)
func SetFormatter ¶
func SetFormatter(f Formatter)
Types ¶
type FormatString ¶
type FormatString struct {
// contains filtered or unexported fields
}
func NewFormatString ¶
func NewFormatString() *FormatString
func (*FormatString) SetDelimiter ¶
func (v *FormatString) SetDelimiter(d byte)
type Log ¶ added in v0.4.1
type Log struct {
// contains filtered or unexported fields
}
Log base model
func (*Log) SetFormatter ¶ added in v0.4.1
type Logger ¶
type Logger interface {
SetOutput(out io.Writer)
SetFormatter(f Formatter)
SetLevel(v uint32)
Fatal(message string, args ...interface{})
Error(message string, args ...interface{})
Warn(message string, args ...interface{})
Info(message string, args ...interface{})
Debug(message string, args ...interface{})
}
Logger base interface
func NewSLogJsonAdapter ¶ added in v0.4.1
func NewSLogJsonAdapter() Logger
func NewSLogStringAdapter ¶ added in v0.4.1
func NewSLogStringAdapter() Logger
type Message ¶
type Message struct {
Time time.Time `json:"time" yaml:"time"`
Level string `json:"level" yaml:"level"`
Message string `json:"msg" yaml:"msg"`
Ctx []interface{} `json:"-"`
Map map[string]string `json:"ctx,omitempty" yaml:"ctx,omitempty,inline"`
}
func (Message) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Message) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Message) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Message) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.