zerolog icon indicating copy to clipboard operation
zerolog copied to clipboard

Set / modify time format per logger instance

Open v-byte-cpu opened this issue 2 years ago • 2 comments

I would like to change a time format for different logger instances, but currently the time format is set by the global constant zerolog.TimeFieldFormat and used explicitly in timestamp hook https://github.com/rs/zerolog/blob/55aaf043cf4d84249a6d2344ef18d82279d08955/event.go#L647-L653:

v-byte-cpu avatar Oct 02 '22 20:10 v-byte-cpu

You catch it, that's one reason of why I re-write another similar logger instead of forking. maybe worth see https://github.com/phuslu/log#logger

phuslu avatar Oct 21 '22 19:10 phuslu

seems pretty good, will try it soon

v-byte-cpu avatar Oct 21 '22 19:10 v-byte-cpu