backport some fixes from the main branch

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-03-04 19:14:39 +01:00
parent 8a6c2265a4
commit 97122ef06c
5 changed files with 57 additions and 48 deletions

View File

@@ -41,6 +41,10 @@ var (
rollingLogger *lumberjack.Logger
)
func init() {
zerolog.TimeFieldFormat = dateFormat
}
// StdLoggerWrapper is a wrapper for standard logger compatibility
type StdLoggerWrapper struct {
Sender string
@@ -138,7 +142,6 @@ func GetLogger() *zerolog.Logger {
// SetLogTime sets logging time related setting
func SetLogTime(utc bool) {
zerolog.TimeFieldFormat = dateFormat
if utc {
zerolog.TimestampFunc = func() time.Time {
return time.Now().UTC()