Logging better?

Former-commit-id: 5fedc2bef1
This commit is contained in:
Owen
2025-07-23 21:59:05 -07:00
parent 0f717aec01
commit 4d33016389
6 changed files with 308 additions and 45 deletions

27
logger/level.go Normal file
View File

@@ -0,0 +1,27 @@
package logger
type LogLevel int
const (
DEBUG LogLevel = iota
INFO
WARN
ERROR
FATAL
)
var levelStrings = map[LogLevel]string{
DEBUG: "DEBUG",
INFO: "INFO",
WARN: "WARN",
ERROR: "ERROR",
FATAL: "FATAL",
}
// String returns the string representation of the log level
func (l LogLevel) String() string {
if s, ok := levelStrings[l]; ok {
return s
}
return "UNKNOWN"
}