log: SetFormat: include returns in switch

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-16 21:58:38 +02:00
parent 6fe7e03b80
commit 40ee5fb11b
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -89,15 +89,15 @@ func SetFormat(format string) error {
TimestampFormat: RFC3339NanoFixed, TimestampFormat: RFC3339NanoFixed,
FullTimestamp: true, FullTimestamp: true,
}) })
return nil
case JSONFormat: case JSONFormat:
logrus.SetFormatter(&logrus.JSONFormatter{ logrus.SetFormatter(&logrus.JSONFormatter{
TimestampFormat: RFC3339NanoFixed, TimestampFormat: RFC3339NanoFixed,
}) })
return nil
default: default:
return fmt.Errorf("unknown log format: %s", format) return fmt.Errorf("unknown log format: %s", format)
} }
return nil
} }
// WithLogger returns a new context with the provided logger. Use in // WithLogger returns a new context with the provided logger. Use in