nwe default logger

This commit is contained in:
a 2022-12-28 04:18:00 -06:00
parent 660e96877b
commit a61f91287f
1 changed files with 7 additions and 5 deletions

View File

@ -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 {