nwe default logger
This commit is contained in:
parent
660e96877b
commit
a61f91287f
12
log/log.go
12
log/log.go
|
@ -8,15 +8,17 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog"
|
||||||
"tuxpa.in/a/zlog"
|
"tuxpa.in/a/zlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Logger is the global logger.
|
// Logger is the global logger.
|
||||||
var Logger = zlog.New(os.Stderr).With().Timestamp().Logger()
|
var Logger = zlog.New(nil).Output(
|
||||||
|
zerolog.ConsoleWriter{
|
||||||
func init() {
|
Out: os.Stderr,
|
||||||
zlog.TimeFieldFormat = time.StampMicro
|
TimeFormat: time.RFC3339,
|
||||||
}
|
},
|
||||||
|
).With().Timestamp().Logger()
|
||||||
|
|
||||||
// Output duplicates the global logger and sets w as its output.
|
// Output duplicates the global logger and sets w as its output.
|
||||||
func Output(w io.Writer) zlog.Logger {
|
func Output(w io.Writer) zlog.Logger {
|
||||||
|
|
Loading…
Reference in New Issue