From d0f9042fb6187fcfe7d6002277ca1553f042c94b Mon Sep 17 00:00:00 2001 From: mihalin Date: Wed, 19 Jan 2022 15:48:50 +0300 Subject: [PATCH] logging --- main.py | 3 --- migrate.py | 3 --- server/custom.py | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/main.py b/main.py index d877754..e33eeeb 100644 --- a/main.py +++ b/main.py @@ -15,9 +15,6 @@ import olgram.commands.info # noqa: F401 from server.server import main as server_main -import logging -logging.basicConfig(level=logging.INFO) - async def init_database(): await Tortoise.init(config=TORTOISE_ORM) diff --git a/migrate.py b/migrate.py index 6214856..0eb50c4 100644 --- a/migrate.py +++ b/migrate.py @@ -1,9 +1,6 @@ import asyncio -import logging from olgram.migrations.custom import migrate -logging.basicConfig(level=logging.INFO) - if __name__ == '__main__': asyncio.get_event_loop().run_until_complete(migrate()) diff --git a/server/custom.py b/server/custom.py index c93734b..c3ef258 100644 --- a/server/custom.py +++ b/server/custom.py @@ -13,8 +13,8 @@ from olgram.settings import ServerSettings from olgram.models.models import Bot, GroupChat, BannedUser -logging.basicConfig(level=logging.INFO) _logger = logging.getLogger(__name__) +_logger.setLevel(logging.INFO) db_bot_instance: ContextVar[Bot] = ContextVar('db_bot_instance')