You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
538 B
23 lines
538 B
3 years ago
|
package log
|
||
|
|
||
|
//go:generate stringer -type=Level -linecomment
|
||
|
|
||
|
// Level log.
|
||
|
type Level uint8
|
||
|
|
||
|
// awailable log levels.
|
||
|
const (
|
||
|
LevelEmergency Level = iota // emergency
|
||
|
LevelAlert // alert
|
||
|
LevelCritical // critical
|
||
|
LevelError // error
|
||
|
LevelWarning // warning
|
||
|
LevelNotice // notice
|
||
|
LevelInfo // info
|
||
|
LevelDebug // debug
|
||
|
)
|
||
|
|
||
|
func (l Level) MarshalJSON() ([]byte, error) {
|
||
|
return []byte("\"" + l.String() + "\""), nil
|
||
|
}
|