Merge pull request #1 from soaska/pull-request1

Debug option added to env
This commit is contained in:
Alex Borisov 2024-01-29 13:33:41 +03:00 committed by GitHub
commit 592e58766b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

3
bot.py
View File

@ -44,6 +44,9 @@ 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")
if os.getenv('DEBUG') == "yes":
logging.getLogger('aiogram').setLevel(logging.DEBUG)
else:
logging.getLogger('aiogram').setLevel(logging.DEBUG) logging.getLogger('aiogram').setLevel(logging.DEBUG)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -9,3 +9,4 @@ 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