Skip to content

Commit f0448ae

Browse files
Do not override global logger time format (#101)
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.
2 parents 008e852 + b857bc3 commit f0448ae

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

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)