Skip to content

Commit

Permalink
Merge pull request #8604 from RobQuistNL/patch-6
Browse files Browse the repository at this point in the history
fix: Make markets logger less noisy when doing retrievals
  • Loading branch information
magik6k authored May 5, 2022
2 parents d8f1380 + 767a53f commit 3184eb9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions markets/loggers/loggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ func StorageProviderLogger(event storagemarket.ProviderEvent, deal storagemarket

// RetrievalClientLogger logs events from the retrieval client
func RetrievalClientLogger(event retrievalmarket.ClientEvent, deal retrievalmarket.ClientDealState) {
log.Infow("retrieval client event", "name", retrievalmarket.ClientEvents[event], "deal ID", deal.ID, "state", retrievalmarket.DealStatuses[deal.Status], "message", deal.Message)
method := log.Infow
if event == retrievalmarket.ClientEventBlocksReceived {
method = log.Debugw
}
method("retrieval client event", "name", retrievalmarket.ClientEvents[event], "deal ID", deal.ID, "state", retrievalmarket.DealStatuses[deal.Status], "message", deal.Message)
}

// RetrievalProviderLogger logs events from the retrieval provider
func RetrievalProviderLogger(event retrievalmarket.ProviderEvent, deal retrievalmarket.ProviderDealState) {
log.Infow("retrieval provider event", "name", retrievalmarket.ProviderEvents[event], "deal ID", deal.ID, "receiver", deal.Receiver, "state", retrievalmarket.DealStatuses[deal.Status], "message", deal.Message)
method := log.Infow
if event == retrievalmarket.ProviderEventBlockSent {
method = log.Debugw
}
method("retrieval provider event", "name", retrievalmarket.ProviderEvents[event], "deal ID", deal.ID, "receiver", deal.Receiver, "state", retrievalmarket.DealStatuses[deal.Status], "message", deal.Message)
}

// DataTransferLogger logs events from the data transfer module
Expand Down

0 comments on commit 3184eb9

Please sign in to comment.