Skip to content

Commit

Permalink
fix: Switch default logging to JSON
Browse files Browse the repository at this point in the history
Signed-off-by: Teddy Wahle <[email protected]>
  • Loading branch information
teddy-wahle committed Jan 24, 2025
1 parent bcf2143 commit 662dcf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions util/log/logrus.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ func CreateFormatter(logFormat string) logrus.Formatter {
TimestampFormat: checkTimestampFormat(),
}
default:
formatType = &logrus.TextFormatter{
FullTimestamp: checkEnableFullTimestamp(),
formatType = &logrus.JSONFormatter{
TimestampFormat: checkTimestampFormat(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion util/log/logrus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ func TestCreateFormatter(t *testing.T) {
})
t.Run("log format is not json or text", func(t *testing.T) {
result := CreateFormatter("xml")
assert.Equal(t, &logrus.TextFormatter{}, result)
assert.Equal(t, &logrus.JSONFormatter{}, result)
})
}

0 comments on commit 662dcf7

Please sign in to comment.