mirror of
https://github.com/ncarlier/webhookd.git
synced 2024-09-20 08:55:28 +00:00
feat(): improve logger
This commit is contained in:
parent
1df83339c8
commit
e663336ecb
|
@ -37,8 +37,13 @@ func Init(level string) {
|
||||||
warnHandle = ioutil.Discard
|
warnHandle = ioutil.Discard
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug = log.New(debugHandle, "DEBUG: ", log.Ldate|log.Ltime|log.Lshortfile)
|
commonFlags := log.LstdFlags | log.Lmicroseconds
|
||||||
Info = log.New(infoHandle, "INFO: ", log.Ldate|log.Ltime|log.Lshortfile)
|
if level == "debug" {
|
||||||
Warning = log.New(warnHandle, "WARNING: ", log.Ldate|log.Ltime|log.Lshortfile)
|
commonFlags = log.LstdFlags | log.Lmicroseconds | log.Lshortfile
|
||||||
Error = log.New(errorHandle, "ERROR: ", log.Ldate|log.Ltime|log.Lshortfile)
|
}
|
||||||
|
|
||||||
|
Debug = log.New(debugHandle, "DBG ", commonFlags)
|
||||||
|
Info = log.New(infoHandle, "INF ", commonFlags)
|
||||||
|
Warning = log.New(warnHandle, "WRN ", commonFlags)
|
||||||
|
Error = log.New(errorHandle, "ERR ", commonFlags)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user