Make markets logger less noise when doing retrievals
Logging each block causes a lot of useless information in the logs
This commit is contained in:
parent
d8f1380ec9
commit
767a53f8c3
@ -22,12 +22,20 @@ func StorageProviderLogger(event storagemarket.ProviderEvent, deal storagemarket
|
|||||||
|
|
||||||
// RetrievalClientLogger logs events from the retrieval client
|
// RetrievalClientLogger logs events from the retrieval client
|
||||||
func RetrievalClientLogger(event retrievalmarket.ClientEvent, deal retrievalmarket.ClientDealState) {
|
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
|
// RetrievalProviderLogger logs events from the retrieval provider
|
||||||
func RetrievalProviderLogger(event retrievalmarket.ProviderEvent, deal retrievalmarket.ProviderDealState) {
|
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
|
// DataTransferLogger logs events from the data transfer module
|
||||||
|
Loading…
Reference in New Issue
Block a user