plenty of changes to make the package more ergonomic

Including: bug fixes, api changes, new packages, and more!
This commit is contained in:
2024-05-17 15:31:35 +02:00
parent e835318689
commit 3c51f5575b
10 changed files with 378 additions and 178 deletions

View File

@ -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
}