From 230c03942d258a72c591b9baf376c65e3d37e0ae Mon Sep 17 00:00:00 2001 From: Pavel_Durov Date: Sun, 11 Dec 2022 05:19:10 -0500 Subject: [PATCH] revert 92db05094571139347a0e422b09288096bb5d83b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert Изменил(а) на 'bot.py' --- bot.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bot.py b/bot.py index b886833..0d2fb06 100644 --- a/bot.py +++ b/bot.py @@ -9,11 +9,27 @@ 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)