forked from samarth1220/Userge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.py
29 lines (24 loc) · 1.04 KB
/
logger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
#
# This file is part of < https://github.com/UsergeTeam/Userge > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE >
#
# All rights reserved.
__all__ = ['logging']
import os
import logging
from logging.handlers import RotatingFileHandler
if not os.path.isdir("logs"):
os.mkdir("logs")
logging.basicConfig(level=logging.INFO,
format='[%(asctime)s - %(levelname)s] - %(name)s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S',
handlers=[
RotatingFileHandler(
"logs/userge.log", maxBytes=(20480), backupCount=10),
logging.StreamHandler()
])
logging.getLogger("pyrogram").setLevel(logging.WARNING)
logging.getLogger("pyrogram.client.parser.html").setLevel(logging.ERROR)
logging.getLogger('googleapiclient.discovery').setLevel(logging.WARNING)