diff --git a/Mantid.user.properties b/Mantid.user.properties deleted file mode 100644 index 7d70a1d..0000000 --- a/Mantid.user.properties +++ /dev/null @@ -1 +0,0 @@ -UpdateInstrumentDefinitions.OnStartup = 0 \ No newline at end of file diff --git a/src/mvesuvio/main/__init__.py b/src/mvesuvio/main/__init__.py index 7295faf..517a64b 100644 --- a/src/mvesuvio/main/__init__.py +++ b/src/mvesuvio/main/__init__.py @@ -44,6 +44,9 @@ def __set_up_parser(): def __setup_config(args): + + __set_logging_properties() + config_dir = handle_config.VESUVIO_CONFIG_PATH handle_config.setup_config_dir(config_dir) ipfolder_dir = handle_config.VESUVIO_IPFOLDER_PATH @@ -80,10 +83,22 @@ def __setup_config(args): handle_config.check_dir_exists("IP folder", ipfolder_dir) +def __set_logging_properties(): + from mantid.kernel import ConfigService + ConfigService.setString("logging.loggers.root.channel.class", "SplitterChannel") + ConfigService.setString("logging.loggers.root.channel.channel1", "consoleChannel") + ConfigService.setString("logging.loggers.root.channel.channel2", "fileChannel") + ConfigService.setString("logging.channels.consoleChannel.class", "ConsoleChannel") + ConfigService.setString("logging.channels.fileChannel.class", "FileChannel") + ConfigService.setString("logging.channels.fileChannel.path", "mantid.log") + ConfigService.setString("logging.channels.fileChannel.formatter.class", "PatternFormatter") + ConfigService.setString("logging.channels.fileChannel.formatter.pattern", "%Y-%m-%d %H:%M:%S,%i [%I] %p %s - %t") + mantid_properties_file = path.join(ConfigService.getPropertiesDir(), "Mantid.properties") + ConfigService.saveConfig(mantid_properties_file) + return + + def __run_analysis(): - environ["MANTIDPROPERTIES"] = path.join( - handle_config.VESUVIO_CONFIG_PATH, "Mantid.user.properties" - ) from mvesuvio.main.run_routine import Runner Runner().run() diff --git a/src/mvesuvio/util/analysis_helpers.py b/src/mvesuvio/util/analysis_helpers.py index b2453bc..599e225 100644 --- a/src/mvesuvio/util/analysis_helpers.py +++ b/src/mvesuvio/util/analysis_helpers.py @@ -59,7 +59,7 @@ def is_hydrogen_present(masses) -> bool: def ws_history_matches_inputs(runs, mode, ipfile, ws_path): if not (ws_path.is_file()): - logger.notice("Cached workspace not found") + logger.notice(f"Cached workspace not found at {ws_path}") return False ws = Load(Filename=str(ws_path))