Skip to content

[merge-to-it] logging_config: console format API, dotted-prefix colours, cached lookups - #1203

Merged
lotusl-code merged 3 commits into
mainfrom
merge-to-it/logging-config-console-format-prefix-cache
Oct 9, 2026
Merged

lotusl-code merged 3 commits into
mainfrom
merge-to-it/logging-config-console-format-prefix-cache

Conversation

@lotusl-code

@lotusl-code lotusl-code commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

[merge-to-it]

Summary

Three tightly coupled console changes, kept together because the code cannot be split between them (the formatter's colour lookup is _logger_color(record.name) if terminal else None, the lookup only exists in cached form, and one typing import serves both the format TypedDict and the lookup's TypeVar):

  • Console format interface. set_console_format() updates the console columns (show_time, show_level, show_logger_name, show_pid, use_short_name). The default is time (HH:MM:SS.mmm), level and the last logger-name segment, without the pid. Only the console drops the date (_CONSOLE_DATE_FORMAT, log_bridge's kConsolePattern); Python and C++ log files keep the full LINE_FORMAT with DATE_FORMAT / kFilePattern.
  • Dotted-prefix colours. A colour set for a logger also covers its dotted descendants; the most specific name wins.
  • Cached lookups. Colour lookups are cached per logger name over a copy of the table, rebuilt by every set_logger_colors() call.
  • CI's WujiGlovePlugin marker matches the short logger name.

Until #1204 lands, set_console_format is imported by its own from ._console import (...) statement next to the existing one-line import; #1204 consolidates them.

Stack: targets the integration branch that merges #1201 and #1202.

Testing

  • tests/python/core/logging_config incl. test_routing.py with the C++ emitter; clang-format-14 on sink_config.cpp; pre-commit.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Console logging can now be configured to show or hide the time, level, logger name, and process ID. By default, it shows the time, level, and shortened logger name.
    • Logger colors now apply to matching nested logger names, with the closest configured match taking precedence.
  • Improvements

    • Console timestamps now show the time of day without the date; log-file timestamps remain unchanged.
    • CloudXR bring-up checks now recognize the Wuji plugin’s logger name.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/IsaacCapture/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: fd38cf04-29b2-4165-b2c5-f398df083d2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/IsaacCapture/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: f2307026-fadc-46d2-95e6-365d309c16a2

📥 Commits

Reviewing files that changed from the base of the PR and between 5d088f0 and cce4386.


📒 Files selected for processing (8)
  • .github/workflows/build-ubuntu.yml
  • src/core/log_bridge/cpp/sink_config.cpp
  • src/python/isaaccapture/logging_config/__init__.py
  • src/python/isaaccapture/logging_config/_console.py
  • tests/python/core/logging_config/conftest.py
  • tests/python/core/logging_config/test_console.py
  • tests/python/core/logging_config/test_core.py
  • tests/python/core/logging_config/test_routing.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

Python console logging now supports configurable columns, short logger names, and inherited logger colors. The package exports set_console_format. C++ stderr sinks use timestamps without dates, while rotating-file logs retain the date. Tests and the Ubuntu workflow check the updated console formats and Wuji plugin logger name.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant set_console_format
  participant _console_formatter
  participant ConsoleHandler
  Caller->>set_console_format: supply console format changes
  set_console_format->>_console_formatter: build formatter from updated options
  _console_formatter->>ConsoleHandler: replace handler formatter
Loading

Merge Risk: ⚪ Minimal · up to cce43

No actionable issue is established for this change; it is mergeable after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 31.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 7 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main changes: the console format API, dotted-prefix logger colors, and cached lookups.

Full details: Docstring Coverage

Explanation

Docstring coverage is 31.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 35 functions across 7 files. (1 skipped: 1 unsupported.)



✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Comment thread src/python/isaaccapture/logging_config/_core.py Outdated
@ivany-nv ivany-nv added the NVIDIA label Oct 7, 2026
@lotusl-code
lotusl-code added this pull request to stack #1233 October 9, 2026 22:01
@lotusl-code
lotusl-code removed this pull request from stack #1233 October 9, 2026 22:42
@lotusl-code
lotusl-code changed the base branch from merge-to-it/logging-config-integrate-oob-and-args to main October 9, 2026 22:43
@lotusl-code
lotusl-code changed the base branch from main to merge-to-it/logging-config-integrate-oob-and-args October 9, 2026 22:43
lotusl-code and others added 2 commits October 9, 2026 15:44
…rs, cached lookups

- set_console_format() sets the console columns; the default shows
  time (HH:MM:SS.mmm), level and the last logger-name segment, no pid.
  DATE_FORMAT and log_bridge's kPattern drop the date.
- Logger colours cover dotted descendants (most specific wins), through
  a lookup cached per logger name and rebuilt on every change.
- CI's WujiGlovePlugin marker matches the short logger name.

Signed-off-by: Lotus Li <lotusl@nvidia.com>
…the console only

Dropping the date from the shared DATE_FORMAT and from log_bridge's
kPattern also removed it from Python and C++ log files, which makes
sessions that cross midnight, rotated files and cross-process
correlation ambiguous. DATE_FORMAT keeps the full date again; the
console formatter uses its own _CONSOLE_DATE_FORMAT, and log_bridge
splits kPattern into kFilePattern (dated) and kConsolePattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lotus Li <lotusl@nvidia.com>
@lotusl-code
lotusl-code force-pushed the merge-to-it/logging-config-console-format-prefix-cache branch from 5d9f469 to cce4386 Compare October 9, 2026 22:44
@lotusl-code
lotusl-code changed the base branch from merge-to-it/logging-config-integrate-oob-and-args to main October 9, 2026 22:45
@lotusl-code
lotusl-code added this pull request to stack #1235 October 9, 2026 22:48
Signed-off-by: Lotus Li <lotusl@nvidia.com>
@lotusl-code
lotusl-code force-pushed the merge-to-it/logging-config-console-format-prefix-cache branch from f182f86 to 2300194 Compare October 9, 2026 23:17
@lotusl-code
lotusl-code removed this pull request from stack #1235 October 9, 2026 23:33
@lotusl-code
lotusl-code enabled stacked auto-merge (squash) October 9, 2026 23:33
@lotusl-code
lotusl-code disabled stacked auto-merge October 9, 2026 23:35
@lotusl-code
lotusl-code added this pull request to stack #1237 October 9, 2026 23:35
@lotusl-code
lotusl-code merged commit 2b51cfc into main Oct 9, 2026
33 checks passed
@lotusl-code
lotusl-code deleted the merge-to-it/logging-config-console-format-prefix-cache branch October 9, 2026 23:43
lotusl-code added a commit that referenced this pull request Oct 10, 2026
…content filters (#1204)

* [merge-to-it] logging_config: console format API, dotted-prefix colours, cached lookups (#1203)

* [merge-to-it] logging_config: console format API, dotted-prefix colours, cached lookups

- set_console_format() sets the console columns; the default shows
  time (HH:MM:SS.mmm), level and the last logger-name segment, no pid.
  DATE_FORMAT and log_bridge's kPattern drop the date.
- Logger colours cover dotted descendants (most specific wins), through
  a lookup cached per logger name and rebuilt on every change.
- CI's WujiGlovePlugin marker matches the short logger name.

Signed-off-by: Lotus Li <lotusl@nvidia.com>

* [merge-to-it] logging_config: keep the date in log files, drop it on the console only

Dropping the date from the shared DATE_FORMAT and from log_bridge's
kPattern also removed it from Python and C++ log files, which makes
sessions that cross midnight, rotated files and cross-process
correlation ambiguous. DATE_FORMAT keeps the full date again; the
console formatter uses its own _CONSOLE_DATE_FORMAT, and log_bridge
splits kPattern into kFilePattern (dated) and kConsolePattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lotus Li <lotusl@nvidia.com>

* ci: retrigger checks

Signed-off-by: Lotus Li <lotusl@nvidia.com>

---------

Signed-off-by: Lotus Li <lotusl@nvidia.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* [merge-to-it] logging_config: split set_console_filter into name and content filters

set_console_logger_name_filter(names) keeps records from the given
loggers and their dotted descendants; set_console_content_filter(pattern)
keeps records whose message matches the regex. A record must pass both;
each setter builds a new cached matcher, and an invalid pattern is
logged instead of raised.

Signed-off-by: Lotus Li <lotusl@nvidia.com>

* [merge-to-it] logging_config: report whether the console content filter was applied

set_console_content_filter() returned None both when it applied a pattern
and when it rejected an invalid one, so a caller could not tell its regex
was refused and the previous filter kept. It now returns True when the
filter is applied or removed and False when the pattern is rejected; the
error is still logged and the current filter retained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lotus Li <lotusl@nvidia.com>

---------

Signed-off-by: Lotus Li <lotusl@nvidia.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
dev — 23001940 Deployed Oct 9, 2026 by lotusl-code via publish-wheel #5499
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants