Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logging logfmt use sync-logger #102

Merged
merged 11 commits into from
Mar 18, 2021
2 changes: 1 addition & 1 deletion logging/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func NewLogger(format string) (logger log.Logger) {
return term.FgBgColor{}
}
logger = term.NewLogger(os.Stdout, log.NewLogfmtLogger, colorFn)
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
logger = log.With(log.NewSyncLogger(logger), "ts", log.DefaultTimestampUTC)
return logger
}
}
Expand Down
4 changes: 4 additions & 0 deletions logging/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ func TestWithLevel(t *testing.T) {
// ensure the caller depth is correct
assert.Contains(t, buf.String(), "caller=log_test.go")
}

func TestNewLogger(t *testing.T) {
_ = NewLogger("logfmt")
}