Logging with loguru (#708)

* logging

* requirements

* add loguru dependency

* restore it

* add loguru

* set log level in .env file

* remove service fee print

* set log level

* more logging

* more logging

* more logging

* pyament.checking_id

* fix
This commit is contained in:
calle
2022-07-07 14:30:16 +02:00
committed by GitHub
parent 847fd18796
commit 089313f613
40 changed files with 202 additions and 81 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
import asyncio
from typing import Callable, NamedTuple
from loguru import logger
import httpx
currencies = {
@@ -280,7 +282,7 @@ async def btc_price(currency: str) -> float:
if not rates:
return 9999999999
elif len(rates) == 1:
print("Warning could only fetch one Bitcoin price.")
logger.warn("Could only fetch one Bitcoin price.")
return sum([rate for rate in rates]) / len(rates)