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 # Other library imports
from core.models import Aggregator, OperatorWallets, Platform from core.models import Aggregator, OperatorWallets, Platform
from core.util import logs
# TODO: secure ES traffic properly # TODO: secure ES traffic properly
urllib3.disable_warnings() urllib3.disable_warnings()
@ -20,6 +21,8 @@ tracer.setLevel(logging.CRITICAL)
tracer = logging.getLogger("elastic_transport.transport") tracer = logging.getLogger("elastic_transport.transport")
tracer.setLevel(logging.CRITICAL) tracer.setLevel(logging.CRITICAL)
log = logs.get_logger("money")
class Money(object): class Money(object):
""" """
@ -134,7 +137,7 @@ class Money(object):
async def get_minmax(self, min_usd, max_usd, asset, currency): async def get_minmax(self, min_usd, max_usd, asset, currency):
rates = await self.get_rates_all() rates = await self.get_rates_all()
if currency not in rates and not currency == "USD": 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 return
if currency == "USD": if currency == "USD":
min_amount = min_usd min_amount = min_usd