logger: fix UTC time func
Fixes #719 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
1fccd05e9e
commit
ebbbf81e65
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue