mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-01 10:34:51 +00:00
Fix
This commit is contained in:
parent
cfadbd3a91
commit
e99fb06724
2 changed files with 7 additions and 12 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import os
|
||||
import time
|
||||
import logging
|
||||
from logging import ERROR, getLogger
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
from logging import ERROR, INFO, FileHandler, StreamHandler, basicConfig, getLogger
|
||||
|
||||
import pyromod.listen
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
|
|
@ -12,15 +11,11 @@ from pyrogram import Client
|
|||
|
||||
from misskaty.vars import API_HASH, API_ID, BOT_TOKEN, DATABASE_URI, USER_SESSION, TZ
|
||||
|
||||
logger = getLogger(__name__)
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
# CONFIGURATION TO ROTATE LOGS EVERYDAY
|
||||
rotate = TimedRotatingFileHandler("MissKatyLogs.txt", when='D', interval=1, backupCount=0, encoding=None, delay=False, utc=False)
|
||||
logger.addHandler(rotate)
|
||||
formater = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
rotate.setFormatter(formater)
|
||||
|
||||
basicConfig(
|
||||
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
||||
handlers=[FileHandler("MissKatyLogs.txt"), StreamHandler()],
|
||||
level=INFO,
|
||||
)
|
||||
getLogger("pyrogram").setLevel(ERROR)
|
||||
|
||||
MOD_LOAD = []
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ async def clear_reqdict():
|
|||
try:
|
||||
os.rmdir("downloads")
|
||||
os.remove("MissKatyLogs.txt")
|
||||
open("MissKatyLogs.txt", "w")
|
||||
open("MissKatyLogs.txt", "w").close()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue