mirror of
https://codeberg.org/crowci/crow.git
synced 2025-08-06 09:22:46 +03:00
Clean up logging (#3161)
- use `Err` method instead of format strings - use `Msg` if no format string is used
This commit is contained in:
@@ -99,13 +99,13 @@ func configFromCliContext(ctx context.Context) (*config, error) {
|
||||
// Unmarshal label and annotation settings here to ensure they're valid on startup
|
||||
if labels := c.String("backend-k8s-pod-labels"); labels != "" {
|
||||
if err := yaml.Unmarshal([]byte(labels), &config.PodLabels); err != nil {
|
||||
log.Error().Msgf("could not unmarshal pod labels '%s': %s", c.String("backend-k8s-pod-labels"), err)
|
||||
log.Error().Err(err).Msgf("could not unmarshal pod labels '%s'", c.String("backend-k8s-pod-labels"))
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if annotations := c.String("backend-k8s-pod-annotations"); annotations != "" {
|
||||
if err := yaml.Unmarshal([]byte(c.String("backend-k8s-pod-annotations")), &config.PodAnnotations); err != nil {
|
||||
log.Error().Msgf("could not unmarshal pod annotations '%s': %s", c.String("backend-k8s-pod-annotations"), err)
|
||||
log.Error().Err(err).Msgf("could not unmarshal pod annotations '%s'", c.String("backend-k8s-pod-annotations"))
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user