From 89f2726e48dbc44bfa857c072a6dd5098d3d7281 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 30 Jul 2020 18:04:03 +0100 Subject: [PATCH] Set internal and found plugin module_name separately. Settled on `plugins..found` as the format. --- EDMCLogging.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EDMCLogging.py b/EDMCLogging.py index 8bba3f13..41f06044 100644 --- a/EDMCLogging.py +++ b/EDMCLogging.py @@ -208,10 +208,15 @@ class EDMCContextFilter(logging.Filter): # Is this a 'found' plugin calling us? file_name = pathlib.Path(frame_info.filename).expanduser() plugin_dir = pathlib.Path(config.plugin_dir).expanduser() + internal_plugin_dir = pathlib.Path(config.internal_plugin_dir).expanduser() + if file_name.parent.parent == plugin_dir: # Pre-pend 'plugins..' to module module_name = f'.{file_name.parent.name}.{module_name}' + elif file_name.parent == internal_plugin_dir: + module_name = f'plugins.{module_name}' + # https://docs.python.org/3.7/library/inspect.html#the-interpreter-stack del frame