From a61f91287fa219dd60678436c9744de46b70187e Mon Sep 17 00:00:00 2001 From: a Date: Wed, 28 Dec 2022 04:18:00 -0600 Subject: [PATCH] nwe default logger --- log/log.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/log/log.go b/log/log.go index 17ed5ef..15c48c1 100644 --- a/log/log.go +++ b/log/log.go @@ -8,15 +8,17 @@ import ( "os" "time" + "github.com/rs/zerolog" "tuxpa.in/a/zlog" ) // Logger is the global logger. -var Logger = zlog.New(os.Stderr).With().Timestamp().Logger() - -func init() { - zlog.TimeFieldFormat = time.StampMicro -} +var Logger = zlog.New(nil).Output( + zerolog.ConsoleWriter{ + Out: os.Stderr, + TimeFormat: time.RFC3339, + }, +).With().Timestamp().Logger() // Output duplicates the global logger and sets w as its output. func Output(w io.Writer) zlog.Logger {