mirror of
https://github.com/tendermint/tendermint.git
synced 2025-12-23 14:25:19 +00:00
* build(deps): Bump github.com/go-kit/kit from 0.10.0 to 0.12.0 Bumps [github.com/go-kit/kit](https://github.com/go-kit/kit) from 0.10.0 to 0.12.0. - [Release notes](https://github.com/go-kit/kit/releases) - [Commits](https://github.com/go-kit/kit/compare/v0.10.0...v0.12.0) --- updated-dependencies: - dependency-name: github.com/go-kit/kit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * add nolint * fix lint * fix build Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: tycho garen <garen@tychoish.com>
25 lines
716 B
Go
25 lines
716 B
Go
package log
|
|
|
|
import (
|
|
"io"
|
|
|
|
kitlog "github.com/go-kit/log"
|
|
)
|
|
|
|
// NewTMJSONLogger returns a Logger that encodes keyvals to the Writer as a
|
|
// single JSON object. Each log event produces no more than one call to
|
|
// w.Write. The passed Writer must be safe for concurrent use by multiple
|
|
// goroutines if the returned Logger will be used concurrently.
|
|
func NewTMJSONLogger(w io.Writer) Logger {
|
|
logger := kitlog.NewJSONLogger(w)
|
|
logger = kitlog.With(logger, "ts", kitlog.DefaultTimestampUTC)
|
|
return &tmLogger{logger}
|
|
}
|
|
|
|
// NewTMJSONLoggerNoTS is the same as NewTMJSONLogger, but without the
|
|
// timestamp.
|
|
func NewTMJSONLoggerNoTS(w io.Writer) Logger {
|
|
logger := kitlog.NewJSONLogger(w)
|
|
return &tmLogger{logger}
|
|
}
|