add exchange_response logging to funding_fee endpoint

help debug #9626
This commit is contained in:
Matthias
2024-01-01 19:27:18 +01:00
parent 842727202f
commit a2160e4503

View File

@@ -319,10 +319,11 @@ class Exchange:
"""
pass
def _log_exchange_response(self, endpoint, response) -> None:
def _log_exchange_response(self, endpoint: str, response, *, add_info=None) -> None:
""" Log exchange responses """
if self.log_responses:
logger.info(f"API {endpoint}: {response}")
add_info_str = "" if add_info is None else f" {add_info}:"
logger.info(f"API {endpoint}: {add_info_str}{response}")
def ohlcv_candle_limit(
self, timeframe: str, candle_type: CandleType, since_ms: Optional[int] = None) -> int:
@@ -2414,6 +2415,8 @@ class Exchange:
symbol=pair,
since=since
)
self._log_exchange_response('funding_history', funding_history,
add_info=f"pair: {pair}, since: {since}")
return sum(fee['amount'] for fee in funding_history)
except ccxt.DDoSProtection as e:
raise DDosProtection(e) from e