We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06120b4 commit c1d3341Copy full SHA for c1d3341
main.py
@@ -23,8 +23,12 @@
23
24
BOT_TOKEN = "<your_bot_token>"
25
26
+logfile_dir_path = os.path.dirname(os.path.abspath(__file__))
27
+logfile_abs_path = os.path.join(logfile_dir_path, "bot.log")
28
+logfile_handler = logging.FileHandler(logfile_abs_path, 'a', 'utf-8')
29
+
30
logger = logging.getLogger(__name__)
-logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG)
31
+logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG, handlers=[logfile_handler])
32
33
if not re.match("[0-9]+:[a-zA-Z0-9\-_]+", BOT_TOKEN):
34
logging.error("Bot token not correct - please check.")
0 commit comments