From 0825ec4a4378f873536beb4f6af47480b49a6803 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 18 Apr 2023 09:57:52 +0100 Subject: [PATCH] Fix logging in money module --- core/lib/money.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/lib/money.py b/core/lib/money.py index ff99221..0011eb0 100644 --- a/core/lib/money.py +++ b/core/lib/money.py @@ -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