compilation output to logs

This commit is contained in:
2026-07-31 12:52:04 +02:00
parent 22e9a0386c
commit a38d461a36
4 changed files with 26 additions and 4 deletions

View File

@@ -49,6 +49,7 @@ class SimulationFileController(QObject):
except (OSError, RuntimeError, TypeError, ValueError):
logger.exception("Could not open simulation %s", file_path)
raise
self._log_compilation()
self._update_window()
logger.info("Opened simulation: %s", file_path)
@@ -151,3 +152,12 @@ class SimulationFileController(QObject):
self.window.statusBar().showMessage(f"{self.root.component_path} · {compiled}")
self.window.ui.actionSave_Simulation_Run.setEnabled(True)
self.window.ui.actionSimulation_Options.setEnabled(True)
def _log_compilation(self) -> None:
if self.compiled_model is None:
return
logger.info("Compiled model %s: %s", self.compiled_model.model_name, self.compiled_model.executable)
if self.compiled_model.output.strip():
logger.info("Compiler output:\n%s", self.compiled_model.output.strip())
if self.compiled_model.errors.strip():
logger.warning("Compiler errors:\n%s", self.compiled_model.errors.strip())