forked from UsergeTeam/Userge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.py
28 lines (24 loc) · 1.09 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
# pylint: disable=missing-module-docstring
#
# Copyright (C) 2020-2021 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/UsergeTeam/Userge/blob/master/LICENSE >
#
# All rights reserved.
__all__ = ['logging']
import logging
from logging.handlers import RotatingFileHandler
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.parser.html").setLevel(logging.ERROR)
logging.getLogger("pyrogram.session.session").setLevel(logging.ERROR)
logging.getLogger('googleapiclient.discovery').setLevel(logging.WARNING)