From 50e04dd95de3dd41a1389712785f583ca60144fe Mon Sep 17 00:00:00 2001 From: Mikhail Kirillov Date: Mon, 7 Oct 2024 22:39:28 +0400 Subject: Add logging --- app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.py b/app.py index 6149096..3c754e7 100644 --- a/app.py +++ b/app.py @@ -13,9 +13,15 @@ from telegram import Update from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes from dotenv import load_dotenv import os +import logging load_dotenv() +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' +) + async def hello(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: await update.message.reply_text(f'Hello {update.effective_user.first_name}') -- cgit v1.2.3