1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-29 21:48:14 +02: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:
qwerty287
2024-01-10 20:57:12 +01:00
committed by GitHub
parent 12c40eb957
commit 00df53e941
20 changed files with 47 additions and 47 deletions

View File

@@ -41,9 +41,8 @@ func Restart(ctx context.Context, store store.Store, lastPipeline *model.Pipelin
// fetch the old pipeline config from the database
configs, err := store.ConfigsForPipeline(lastPipeline.ID)
if err != nil {
msg := fmt.Sprintf("failure to get pipeline config for %s. %s", repo.FullName, err)
log.Error().Msgf(msg)
return nil, &ErrNotFound{Msg: msg}
log.Error().Err(err).Msgf("failure to get pipeline config for %s", repo.FullName)
return nil, &ErrNotFound{Msg: fmt.Sprintf("failure to get pipeline config for %s. %s", repo.FullName, err)}
}
for _, y := range configs {