bilibili-backup/library/log/level.go

30 lines
483 B
Go
Raw Normal View History

2019-04-22 10:59:20 +08:00
package log
// Level of severity.
type Level int
// Verbose is a boolean type that implements Info, Infov (like Printf) etc.
type Verbose bool
// common log level.
const (
_debugLevel Level = iota
_infoLevel
_warnLevel
_errorLevel
_fatalLevel
)
var levelNames = [...]string{
_debugLevel: "DEBUG",
_infoLevel: "INFO",
_warnLevel: "WARN",
_errorLevel: "ERROR",
_fatalLevel: "FATAL",
}
// String implementation.
func (l Level) String() string {
return levelNames[l]
}