Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion th_cli/test_run/log_viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
.filter-btn.level-debug {{ background: #fafafa; color: #757575; border-color: #e0e0e0; }}
.filter-btn.level-chiptool {{ background: #e0f2f1; color: #00796b; border-color: #4db6ac; }}
.filter-btn.level-python {{ background: #f3e5f5; color: #6a1b9a; border-color: #ba68c8; }}
.filter-btn.level-commissioning {{ background: #fce4ec; color: #ad1457; border-color: #f06292; }}

.filter-btn.active {{ opacity: 1; font-weight: 600; border-width: 2px; }}
.filter-btn:not(.active) {{ opacity: 0.4; }}
Expand Down Expand Up @@ -369,6 +370,7 @@
.log-entry.level-success {{ border-left-color: #4caf50; background: #e8f5e9; }}
.log-entry.level-chiptool {{ border-left-color: #009688; background: #e0f2f1; }}
.log-entry.level-python_test{{ border-left-color: #9c27b0; background: #f3e5f5; }}
.log-entry.level-commissioning {{ border-left-color: #e91e63; background: #fce4ec; font-weight: 600; }}

.log-timestamp {{ color: #666; font-weight: 500; margin-right: 8px; }}
.log-level {{
Expand All @@ -388,6 +390,7 @@
.log-level.SUCCESS {{ background: #4caf50; color: white; }}
.log-level.CHIPTOOL {{ background: #009688; color: white; }}
.log-level.PYTHON_TEST{{ background: #9c27b0; color: white; }}
.log-level.COMMISSIONING {{ background: #e91e63; color: white; }}

.log-message {{ color: #333; }}

Expand Down Expand Up @@ -504,6 +507,7 @@
<button class="filter-btn level-debug" onclick="toggleFilter(this, 'DEBUG')">DEBUG</button>
<button class="filter-btn level-chiptool active" onclick="toggleFilter(this, 'CHIPTOOL')">CHIP</button>
<button class="filter-btn level-python active" onclick="toggleFilter(this, 'PYTHON_TEST')">PYTHON</button>
<button class="filter-btn level-commissioning active" onclick="toggleFilter(this, 'COMMISSIONING')">COMMISSION</button>
</div>
</div>

Expand Down Expand Up @@ -538,7 +542,7 @@
let eventSource = null;
let autoScroll = true;
let logCount = 0;
let activeFilters = new Set(['INFO', 'WARNING', 'ERROR', 'CHIPTOOL', 'PYTHON_TEST', 'SUCCESS']);
let activeFilters = new Set(['INFO', 'WARNING', 'ERROR', 'CHIPTOOL', 'PYTHON_TEST', 'COMMISSIONING', 'SUCCESS']);
let allLogs = [];
let logBatchQueue = [];
let batchProcessing = false;
Expand Down
6 changes: 6 additions & 0 deletions th_cli/test_run/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
PYTHON_TEST_LEVEL = "PYTHON_TEST"
logger.level(PYTHON_TEST_LEVEL, no=22, icon="🐍", color="<cyan>")

# Add custom logger for DUT commissioning behavior of a test case.
# NOTE: must match the level registered by the backend (app/test_engine/logger.py),
# otherwise logger.log(record.level, ...) raises ValueError for unknown levels.
COMMISSIONING_LEVEL = "COMMISSIONING"
logger.level(COMMISSIONING_LEVEL, no=23, icon="🔑", color="<magenta><bold>")

# Global reference to log stream handler (if enabled)
_log_stream_handler: Optional["LogStreamHandler"] = None

Expand Down
Loading