def context(self): if isinstance(self.plugin, Plugin): with self.plugin.context(): yield else: with logger.scope(self.plugin): yield
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)