log: log full level names instead of mispelled "EROR", "DBUG"

This commit is contained in:
Felix Lange
2017-02-23 18:30:32 +01:00
parent e8b3e22612
commit 38e273597c
2 changed files with 24 additions and 4 deletions

View File

@ -24,7 +24,27 @@ const (
LvlTrace
)
// Returns the name of a Lvl
// Aligned returns a 5-character string containing the name of a Lvl.
func (l Lvl) AlignedString() string {
switch l {
case LvlTrace:
return "TRACE"
case LvlDebug:
return "DEBUG"
case LvlInfo:
return "INFO "
case LvlWarn:
return "WARN "
case LvlError:
return "ERROR"
case LvlCrit:
return "CRIT "
default:
panic("bad level")
}
}
// Strings returns the name of a Lvl.
func (l Lvl) String() string {
switch l {
case LvlTrace: