Debug option added to env

This commit is contained in:
Alexander Borisov 2024-01-29 09:47:19 +00:00
parent 0c8b70655e
commit 2c3164ddeb
2 changed files with 6 additions and 2 deletions

5
bot.py
View File

@ -44,7 +44,10 @@ dotenv.load_dotenv()
logging.basicConfig(format="[%(asctime)s] %(levelname)s : %(name)s : %(message)s", logging.basicConfig(format="[%(asctime)s] %(levelname)s : %(name)s : %(message)s",
level=logging.DEBUG, datefmt="%d-%m-%y %H:%M:%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__) logger = logging.getLogger(__name__)

View File

@ -8,4 +8,5 @@ OK_GROUP_ID = 'OK_GROUP_ID_HERE'
SD_HOST = '127.0.0.1' SD_HOST = '127.0.0.1'
SD_PORT = '7861' SD_PORT = '7861'
SD_USERNAME = 'user' SD_USERNAME = 'user'
SD_PASSWORD = '1234' SD_PASSWORD = '1234'
DEBUG = 'no' # 'yes' to debug