Add error handling

This commit is contained in:
Victor Edvardsson 2024-04-14 21:18:49 +02:00
parent 9674cc1f5b
commit 194ac7a5e7
No known key found for this signature in database

View file

@ -50,8 +50,10 @@ func SetDefaultLoggerConfig(cfgMode string, cfgFolder string, cfgLevel log.Level
if LogFormat == "json" {
logFormatter = &log.JSONFormatter{}
} else {
logFormatter = &log.TextFormatter{TimestampFormat: time.RFC3339, FullTimestamp: true, ForceColors: forceColors}
} elseif = "native" {
logFormatter = &log.TextFormatter{TimestampFormat: time.RFC3339, FullTimestamp: true, ForceColors: forceColors}
} else {
return fmt.Errorf("log format '%s' unknown", LogFormat)
}
log.SetFormatter(logFormatter)