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.
30 lines
483 B
30 lines
483 B
6 years ago
|
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]
|
||
|
}
|