Skip to content

Commit

Permalink
fix(log): change the date format
Browse files Browse the repository at this point in the history
Uses RFC3339 with milliseconds and without timezone
  • Loading branch information
torives committed Feb 23, 2024
1 parent 92081a1 commit bcd9007
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/config/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const (
LogLevelError
)

// RFC3339 with milliseconds and without timezone
const defaultTimeFormat = "2006-01-02T15:04:05.000"

type LogLevel uint8

func (l LogLevel) Level() slog.Level {
Expand All @@ -41,6 +44,7 @@ func (l LogLevel) Level() slog.Level {
func InitLog(nodeConfig NodeConfig) {
opts := new(tint.Options)
opts.Level = nodeConfig.CartesiLogLevel
opts.TimeFormat = defaultTimeFormat
if opts.Level == LogLevelDebug {
opts.AddSource = true
// Remove the directory from the source's filename
Expand Down

0 comments on commit bcd9007

Please sign in to comment.