From 2c3164ddeb070b81ccf6ee6b30b40fc064375582 Mon Sep 17 00:00:00 2001 From: Alexander Borisov <113920954+Sosiaka@users.noreply.github.com> Date: Mon, 29 Jan 2024 09:47:19 +0000 Subject: [PATCH] Debug option added to env --- bot.py | 5 ++++- example.env | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 94af007..eeeff65 100644 --- a/bot.py +++ b/bot.py @@ -44,7 +44,10 @@ dotenv.load_dotenv() logging.basicConfig(format="[%(asctime)s] %(levelname)s : %(name)s : %(message)s", level=logging.DEBUG, datefmt="%d-%m-%y %H:%M:%S") -logging.getLogger('aiogram').setLevel(logging.DEBUG) +if os.getenv('DEBUG') == "yes": + logging.getLogger('aiogram').setLevel(logging.DEBUG) +else: + logging.getLogger('aiogram').setLevel(logging.DEBUG) logger = logging.getLogger(__name__) diff --git a/example.env b/example.env index 7106295..90ae34f 100644 --- a/example.env +++ b/example.env @@ -8,4 +8,5 @@ OK_GROUP_ID = 'OK_GROUP_ID_HERE' SD_HOST = '127.0.0.1' SD_PORT = '7861' SD_USERNAME = 'user' -SD_PASSWORD = '1234' \ No newline at end of file +SD_PASSWORD = '1234' +DEBUG = 'no' # 'yes' to debug \ No newline at end of file