logger: fix UTC time func

Fixes #719

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2022-02-14 12:30:00 +01:00
parent 1fccd05e9e
commit ebbbf81e65
No known key found for this signature in database
GPG key ID: 2F1FB59433D5A8CB

View file

@ -140,7 +140,9 @@ func GetLogger() *zerolog.Logger {
func SetLogTime(utc bool) {
zerolog.TimeFieldFormat = dateFormat
if utc {
zerolog.TimestampFunc = time.Now().UTC
zerolog.TimestampFunc = func() time.Time {
return time.Now().UTC()
}
} else {
zerolog.TimestampFunc = time.Now
}