kopia lustrzana https://github.com/Yakifo/amqtt
Fix logger usage
rodzic
2ff81f29bd
commit
f1c4d2fe61
|
@ -10,12 +10,11 @@ from functools import partial
|
||||||
|
|
||||||
class EventLoggerPlugin:
|
class EventLoggerPlugin:
|
||||||
def __init__(self, context):
|
def __init__(self, context):
|
||||||
self.logger = logging.getLogger(__name__)
|
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def log_event(self, *args, **kwargs):
|
def log_event(self, *args, **kwargs):
|
||||||
self.logger.info("### '%s' EVENT FIRED ###" % kwargs['event_name'].replace('old', ''))
|
self.context.logger.info("### '%s' EVENT FIRED ###" % kwargs['event_name'].replace('old', ''))
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name.startswith("on_"):
|
if name.startswith("on_"):
|
||||||
|
|
Ładowanie…
Reference in New Issue