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
+4 -2
View File
@@ -5,6 +5,8 @@ import httpx
from datetime import datetime
from http import HTTPStatus
from loguru import logger
import shortuuid # type: ignore
from fastapi import HTTPException
from fastapi.param_functions import Query
@@ -136,13 +138,13 @@ async def api_lnurl_callback(
)
except Exception as exc:
# webhook fails shouldn't cause the lnurlw to fail since invoice is already paid
print("Caught exception when dispatching webhook url:", exc)
logger.error("Caught exception when dispatching webhook url:", exc)
return {"status": "OK"}
except Exception as e:
await update_withdraw_link(link.id, **changesback)
print(traceback.format_exc())
logger.error(traceback.format_exc())
return {"status": "ERROR", "reason": "Link not working"}