Fix logging in money module

This commit is contained in:
Mark Veidemanis 2023-04-18 09:57:52 +01:00
parent 4fde670b52
commit 0825ec4a43
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,7 @@ from forex_python.converter import CurrencyRates
# Other library imports
from core.models import Aggregator, OperatorWallets, Platform
from core.util import logs
# TODO: secure ES traffic properly
urllib3.disable_warnings()
@ -20,6 +21,8 @@ tracer.setLevel(logging.CRITICAL)
tracer = logging.getLogger("elastic_transport.transport")
tracer.setLevel(logging.CRITICAL)
log = logs.get_logger("money")
class Money(object):
"""
@ -134,7 +137,7 @@ class Money(object):
async def get_minmax(self, min_usd, max_usd, asset, currency):
rates = await self.get_rates_all()
if currency not in rates and not currency == "USD":
self.log.error(f"Can't create ad without rates: {currency}")
log.error(f"Can't create ad without rates: {currency}")
return
if currency == "USD":
min_amount = min_usd