plenty of changes to make the package more ergonomic
Including: bug fixes, api changes, new packages, and more!
This commit is contained in:
@ -8,10 +8,13 @@ import (
|
||||
type SeverityLevel uint8
|
||||
|
||||
const (
|
||||
// A magical zero value.
|
||||
// WARN: DO NOT USE IN LOGS OR BASICALLY EVER
|
||||
unset SeverityLevel = iota
|
||||
// This event requires an immediate action. If you suspect that occurence of an event may signal that the
|
||||
// data will get lost, corrupted, or that the application will change its behaviour following the event in
|
||||
// an undesired way, select the ALERT level.
|
||||
ALERT SeverityLevel = iota
|
||||
ALERT
|
||||
// A critical error has occured. Critical errors are such which can be tough to fix or made the users
|
||||
// experience significantly worse but unlike errors that trigger ALERT they can be fixed at any moment.
|
||||
CRIT
|
||||
@ -50,6 +53,8 @@ func (l SeverityLevel) String() string {
|
||||
return "INFO"
|
||||
case DEBUG:
|
||||
return "DEBUG"
|
||||
case TRACE:
|
||||
return "TRACE"
|
||||
default:
|
||||
return "CRIT"
|
||||
}
|
||||
@ -69,6 +74,8 @@ func FromString(level string) SeverityLevel {
|
||||
return INFO
|
||||
case "DEBUG":
|
||||
return DEBUG
|
||||
case "TRACE":
|
||||
return TRACE
|
||||
default:
|
||||
return CRIT
|
||||
}
|
||||
|
Reference in New Issue
Block a user