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

@@ -69,7 +69,7 @@ func (s *WoodpeckerAuthServer) getAgent(agentID int64, agentToken string) (*mode
agent.Capacity = -1
err := s.store.AgentCreate(agent)
if err != nil {
log.Err(err).Msgf("Error creating system agent: %s", err)
log.Error().Err(err).Msg("Error creating system agent")
return nil, err
}
return agent, nil

View File

@@ -212,7 +212,7 @@ func (s *RPC) Init(c context.Context, id string, state rpc.State) error {
Pipeline: *currentPipeline,
})
if err != nil {
log.Error().Err(err).Msgf("could not marshal JSON")
log.Error().Err(err).Msg("could not marshal JSON")
return
}
s.pubsub.Publish(message)