add files
This commit is contained in:
16
test_log.py
Normal file
16
test_log.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import logging
|
||||
import sys
|
||||
import time
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='[%(asctime)s] %(message)s',
|
||||
handlers=[
|
||||
logging.FileHandler("bot.log", encoding="utf-8"),
|
||||
logging.StreamHandler(sys.stdout)
|
||||
]
|
||||
)
|
||||
|
||||
for i in range(10):
|
||||
logging.info(f"Тестовое сообщение {i}")
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user