Skip to content

Commit

Permalink
Improve Slinky logs to prevent unnecessary logs (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Li authored Apr 2, 2024
1 parent 37bff71 commit fbeeb7c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions protocol/daemons/slinky/client/price_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ func (p *PriceFetcherImpl) FetchPrices(ctx context.Context) error {
if err != nil {
return err
}
p.logger.Info("turned price pair to currency pair",
"string", currencyPairString,
"currency pair", currencyPair.String())

// get the market id for the currency pair
id, err := p.marketPairFetcher.GetIDForPair(currencyPair)
Expand All @@ -93,7 +90,11 @@ func (p *PriceFetcherImpl) FetchPrices(ctx context.Context) error {
p.logger.Error("slinky client returned a price not parsable as uint64", "price", priceString)
continue
}
p.logger.Info("parsed update for", "market id", id, "price", price)
p.logger.Debug("Parsed Slinky price update",
"market id", id,
"price", price,
"string", currencyPairString,
"currency pair", currencyPair.String())

// append the update to the list of MarketPriceUpdates to be sent to the app's price-feed service
updates = append(updates, &api.MarketPriceUpdate{
Expand All @@ -108,6 +109,8 @@ func (p *PriceFetcherImpl) FetchPrices(ctx context.Context) error {
})
}

p.logger.Info("Slinky returned valid market price updates", "count", len(updates), "updates", updates)

// send the updates to the indexPriceCache
if len(updates) == 0 {
p.logger.Info("Slinky returned 0 valid market price updates")
Expand Down

0 comments on commit fbeeb7c

Please sign in to comment.