improved logging
This commit is contained in:
@@ -33,6 +33,7 @@ from python_app.gui.controllers.sections import (
|
||||
build_radar_group,
|
||||
build_switch_group,
|
||||
)
|
||||
from python_app.logging_setup import LOG_LEVELS
|
||||
|
||||
|
||||
class AppWindowUiMixin:
|
||||
@@ -178,6 +179,20 @@ class AppWindowUiMixin:
|
||||
self._log_toggle_button.setObjectName("sectionToggleButton")
|
||||
self._log_toggle_button.clicked.connect(lambda: self._toggle_log_panel())
|
||||
|
||||
# Log-level selector: live verbosity control, persisted to run_config.
|
||||
self._log_level_label = QLabel("Level", self._settings_panel)
|
||||
self._log_level_label.setObjectName("hintLabel")
|
||||
self._log_level_combo = QComboBox(self._settings_panel)
|
||||
self._log_level_combo.setObjectName("logLevelCombo")
|
||||
self._log_level_combo.addItems([name.capitalize() for name in LOG_LEVELS])
|
||||
self._log_level_combo.setToolTip("Logging verbosity — applied live and saved to run_config")
|
||||
current_level = self._defaults_config.logging.level.capitalize()
|
||||
current_index = self._log_level_combo.findText(current_level)
|
||||
if current_index >= 0:
|
||||
self._log_level_combo.setCurrentIndex(current_index)
|
||||
# Connect AFTER seeding the value so reflecting the config does not save it back.
|
||||
self._log_level_combo.currentTextChanged.connect(self._on_log_level_selected)
|
||||
|
||||
self._log_box = QTextEdit(self._settings_panel)
|
||||
self._log_box.setObjectName("runtimeLogBox")
|
||||
self._log_box.setReadOnly(True)
|
||||
@@ -196,6 +211,8 @@ class AppWindowUiMixin:
|
||||
header_layout.setSpacing(8)
|
||||
header_layout.addWidget(self._log_panel_title)
|
||||
header_layout.addStretch(1)
|
||||
header_layout.addWidget(self._log_level_label)
|
||||
header_layout.addWidget(self._log_level_combo)
|
||||
header_layout.addWidget(self._log_toggle_button)
|
||||
|
||||
panel_layout.addWidget(header_row)
|
||||
|
||||
Reference in New Issue
Block a user