Skip to content

Commit

Permalink
fix: logging logfmt use sync-logger (#102)
Browse files Browse the repository at this point in the history
* fix: logging logfmt use sync-logger

* feat(sagas): add mysql store (#100)

* test: fix non-exist bucket

* feat(sagas): add mysql store

* doc: add comment

* fix: alter constructor

* fix: tests

* refactor: block cleanup call

* refactor: block cleanup call

* test: improve coverage

* test: improve coverage

* test: improve coverage

* test: improve coverage

* test: logging NewLogger add empty test

* fix: logging logfmt use sync-logger

* test: logging NewLogger add empty test

* test: NewLogger test logfmt

Co-authored-by: 谷溪 <[email protected]>
  • Loading branch information
GGXXLL and Reasno authored Mar 18, 2021
1 parent de729d8 commit 762e62f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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")
}

0 comments on commit 762e62f

Please sign in to comment.