Пример #1
0
 def context(self):
     if isinstance(self.plugin, Plugin):
         with self.plugin.context():
             yield
     else:
         with logger.scope(self.plugin):
             yield
Пример #2
0
    def context(self):
        from app import config

        original_context = config.context()
        config.context(self.settings.get("config", None))

        with logger.scope(self):
            yield

        config.context(original_context)