Skip to content

Commit

Permalink
Rework logging defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
matt0x6F committed Mar 21, 2024
1 parent 08520bf commit 61712c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/log/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ func sortFields(data logrus.Fields) []string {
}

func parseFormat(format string) logrus.Formatter {
if format == "plain" {
return &logrus.TextFormatter{}
if format == "json" {
return &logrus.JSONFormatter{}
}

return &logrus.JSONFormatter{}
return getDevFormatter()
}
2 changes: 0 additions & 2 deletions pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ func New(cloudProvider string, level logrus.Level, format string) *Logger {
switch cloudProvider {
case "GCP":
l.Formatter = getGCPFormatter()
case "none":
l.Formatter = getDevFormatter()
default:
l.Formatter = parseFormat(format)
}
Expand Down

0 comments on commit 61712c5

Please sign in to comment.