Skip to content

Commit b857bc3

Browse files
committed
Do not override global logger time format
The zerolog timestamp format is global and used by all loggers by default. Mutating this from within a library can introduce unexpected behavioral changes to consuming applications. Signed-off-by: Nathan Yergler <nathan@yergler.net>
1 parent 01fbc21 commit b857bc3

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

logger/logger.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ func init() {
4545
// for tty terminal enable pretty logs
4646
if isatty.IsTerminal(os.Stdout.Fd()) && runtime.GOOS != "windows" {
4747
Logger = &DBSQLLogger{Logger.Output(zerolog.ConsoleWriter{Out: os.Stderr})}
48-
} else {
49-
// UNIX Time is faster and smaller than most timestamps
50-
// If you set zerolog.TimeFieldFormat to an empty string,
51-
// logs will write with UNIX time.
52-
zerolog.TimeFieldFormat = ""
5348
}
5449
// by default only log warns or above
5550
loglvl := zerolog.WarnLevel

0 commit comments

Comments
 (0)