forked from Pavel_Durov/python_bot
45 lines
977 B
Python
45 lines
977 B
Python
import logging
|
|
import graypy
|
|
|
|
from aiogram import executor
|
|
|
|
from create_bot import dp
|
|
from handlers import pipisa, time_new_year, start_help
|
|
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,
|
|
handlers = [ graypy.GELFUDPHandler('localhost', 12201) ]
|
|
)
|
|
( logging.getLogger( ) ).addFilter(TagFilter())
|
|
#logging.LoggerAdapter(logging.getLogger( ), {'tag': 'jack_bot'})
|
|
#root_logger = logging.getLogger( )
|
|
|
|
#handler = graypy.GELFUDPHandler('localhost', 12201)
|
|
#root_logger.addHandler(handler)
|
|
#root_logger.addFilter(TagFilter())
|
|
|
|
|
|
|
|
pipisa.register_handlers_pipisa(dp)
|
|
time_new_year.register_handlers_time(dp)
|
|
start_help.register_handlers_StartHelp(dp)
|
|
sendnot.register_handlers_sendnotal(dp)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
executor.start_polling(dp, skip_updates=True)
|
|
|