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

updated log time to have milliseconds #224

Merged
merged 2 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ type ZeroLogWrapper struct {
zerolog.Logger
}

func init() {
zerolog.TimeFieldFormat = zerolog.TimeFormatUnixMs
}

// Info implements Tendermint's Logger interface and logs with level INFO. A set
// of key/value tuples may be provided to add context to the log. The number of
// tuples must be even and the key of the tuple must be a string.
Expand Down
5 changes: 4 additions & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command) error {

var logWriter io.Writer
if strings.ToLower(serverCtx.Viper.GetString(flags.FlagLogFormat)) == ostcfg.LogFormatPlain {
logWriter = zerolog.ConsoleWriter{Out: os.Stderr}
logWriter = zerolog.ConsoleWriter{
Out: os.Stderr,
TimeFormat: "2006/01/02-15:04:05.999",
}
} else {
logWriter = os.Stderr
}
Expand Down