refactor(logging): add detailed debug logs

This commit is contained in:
2026-08-02 00:44:16 +05:00
parent a74e2eb328
commit 60d67b613a
4 changed files with 172 additions and 83 deletions
+7 -2
View File
@@ -7,14 +7,17 @@ logger = logging.getLogger(__name__)
async def main():
logger.debug("Инициализация Worker")
async with Worker() as worker:
logger.debug("Worker успешно инициализирован")
await worker.check_all()
logger.debug("Worker завершил работу")
if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s | %(levelname)-7s | %(message)s",
level=logging.DEBUG,
format="%(asctime)s | %(levelname)-7s | %(name)-20s | %(message)s",
datefmt="%H:%M:%S",
handlers=[logging.StreamHandler()],
)
@@ -23,7 +26,9 @@ if __name__ == "__main__":
logging.getLogger("opentele2").setLevel(logging.WARNING)
try:
logger.info("Запуск приложения TDATA-Checker")
asyncio.run(main())
logger.info("Приложение завершено")
except KeyboardInterrupt:
logger.info("Прервано пользователем")