Skip to content

Commit

Permalink
log: SetFormat: include returns in switch
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 40ee5fb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Sep 8, 2023
1 parent c3c22f8 commit c193255
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions log/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ func SetFormat(format string) error {
TimestampFormat: RFC3339NanoFixed,
FullTimestamp: true,
})
return nil
case JSONFormat:
logrus.SetFormatter(&logrus.JSONFormatter{
TimestampFormat: RFC3339NanoFixed,
})
return nil
default:
return fmt.Errorf("unknown log format: %s", format)
}

return nil
}

// WithLogger returns a new context with the provided logger. Use in
Expand Down

0 comments on commit c193255

Please sign in to comment.