forked from Pavel_Durov/python_bot
Изменил(а) на 'bot.py'
This commit is contained in:
parent
d351c0eb72
commit
bc7a2e367d
13
bot.py
13
bot.py
@ -8,6 +8,16 @@ from handlers import pipisa, time_new_year, start_help
|
|||||||
from othersq import sendnot
|
from othersq import sendnot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class TagFilter(logging.Filter):
|
||||||
|
def __init__(self):
|
||||||
|
self.tag = 'jack_bot'
|
||||||
|
|
||||||
|
def filter(self, record):
|
||||||
|
record.tag = self.tag
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
@ -15,7 +25,8 @@ root_logger = logging.getLogger( )
|
|||||||
|
|
||||||
handler = graypy.GELFUDPHandler('localhost', 12201)
|
handler = graypy.GELFUDPHandler('localhost', 12201)
|
||||||
root_logger.addHandler(handler)
|
root_logger.addHandler(handler)
|
||||||
logging.LoggerAdapter(root_logger, {'tag': 'jack_bot'})
|
root_logger.addFilter(TagFilter())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pipisa.register_handlers_pipisa(dp)
|
pipisa.register_handlers_pipisa(dp)
|
||||||
|
Loading…
Reference in New Issue
Block a user