Fix bug in logger

This commit is contained in:
Jan Eitzinger 2023-06-01 10:12:45 +02:00
parent 0f87f651f9
commit 0a472d2b39

View File

@ -44,6 +44,7 @@ var (
/* CONFIG */
func Init(lvl string, logdate bool) {
switch lvl {
case "crit":
ErrWriter = io.Discard
@ -70,6 +71,12 @@ func Init(lvl string, logdate bool) {
WarnLog = log.New(WarnWriter, WarnPrefix, log.Lshortfile)
ErrLog = log.New(ErrWriter, ErrPrefix, log.Llongfile)
CritLog = log.New(CritWriter, CritPrefix, log.Llongfile)
} else {
DebugLog = log.New(DebugWriter, DebugPrefix, log.LstdFlags)
InfoLog = log.New(InfoWriter, InfoPrefix, log.LstdFlags|log.Lshortfile)
WarnLog = log.New(WarnWriter, WarnPrefix, log.LstdFlags|log.Lshortfile)
ErrLog = log.New(ErrWriter, ErrPrefix, log.LstdFlags|log.Llongfile)
CritLog = log.New(CritWriter, CritPrefix, log.LstdFlags|log.Llongfile)
}
}