Skip to content

Fix Kit Python info logging#5803

Merged
kellyguo11 merged 1 commit into
isaac-sim:developfrom
AntoineRichard:antoine/fix-kit-python-info-logging
May 27, 2026
Merged

Fix Kit Python info logging#5803
kellyguo11 merged 1 commit into
isaac-sim:developfrom
AntoineRichard:antoine/fix-kit-python-info-logging

Conversation

@AntoineRichard

Copy link
Copy Markdown
Collaborator

Description

Fixes the Kit-backed Python logging path so Isaac Lab INFO records remain visible after SimulationApp installs Kit's logging bridge. This restores the PhysX joint wrench sensor initialization log for Isaac-Ant-v0 with presets=physx while keeping the sensor implementations on standard Python logging.

Fixes the reported joint wrench sensor logging issue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

N/A

Test Plan

  • ./isaaclab.sh -f
  • git diff --check
  • timeout 120s ./isaaclab.sh -p scripts/environments/zero_agent.py --task Isaac-Ant-v0 --num_envs 1 --viz newton presets=physx
    • Verified output includes [INFO]: Joint wrench sensor initialized: 1 envs, 9 bodies
  • ./isaaclab.sh -p -m pytest source/isaaclab_physx/test/sensors/test_joint_wrench_sensor.py::test_initialization_and_shapes

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation (not applicable; no documentation page change required)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (not added per request; verified with existing test and repro command)
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Preserve the intended Python logging level across Kit startup and add an Isaac Lab-scoped INFO stream handler for records hidden by Kit's logging bridge.

This keeps joint wrench sensor initialization logs visible in Kit-backed PhysX launches without changing the sensor implementation.
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels May 27, 2026
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes Isaac Lab INFO log records (most notably the joint wrench sensor init message) being silently swallowed after SimulationApp starts and Kit installs its Python logging bridge at DEBUG level. Three static helpers are added to AppLauncher to snapshot the desired log level before Kit starts and then restore it — plus a dedicated scoped StreamHandler — after Kit's bridge is in place.

  • Default (WARNING) path — Kit bridge handlers are pinned to WARNING so non-isaaclab noise is suppressed, while the scoped handler lets isaaclab.* INFO records reach sys.stdout directly. This path is tested by the stated test plan and appears correct.
  • Verbose / info path — the scoped stdout handler is also added when --verbose or --info is passed, even though _apply_python_logging_level already sets Kit's bridge handlers to INFO/DEBUG; if carb surfaces in the same terminal as Python stdout this will duplicate every isaaclab.* INFO line.
  • The elif WARNING branch calls _apply_python_logging_level(WARNING) (which sets root to WARNING) and then immediately overrides root to INFO; the root-level assignment inside the helper is a no-op here, which is worth documenting or restructuring.

Confidence Score: 3/5

The default (no-flag) path is correct and tested; the --info/--verbose path may produce duplicate log output depending on Kit's carb routing, and was not covered by the test plan.

The fix restores the missing joint-wrench initialization log and the WARNING-mode logic is sound. However, the branch that fires when the user explicitly passes --info or --verbose installs the scoped stdout handler at the same time as Kit's bridge is set to INFO/DEBUG — if carb directs its output to the same console, every isaaclab INFO line will appear twice. This code path was not mentioned in the test plan, so the potential duplicate-output regression is unverified.

source/isaaclab/isaaclab/app/app_launcher.py — the verbose/info branch of _load_extensions needs a second look

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/app/app_launcher.py Adds three static helpers and updates _load_extensions to restore Python INFO logging after Kit's bridge is installed; the default WARNING path is correct, but the verbose/info path installs the scoped stdout handler alongside Kit's bridge at INFO/DEBUG, potentially doubling isaaclab INFO output when carb surfaces in the same terminal.
source/isaaclab/changelog.d/fix-kit-python-info-logging.rst New changelog fragment accurately describing the fix; no issues.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AppLauncher.__init__ called] --> B[_resolve_python_logging_level\nsnapshot level before Kit]
    B --> C[SimulationApp starts\nKit installs Python log bridge at DEBUG]
    C --> D[_load_extensions called]
    D --> E[_apply_python_logging_level\nset root + all handlers to resolved level]
    E --> F{resolved level?}
    F -- "≤ INFO\n(--info / --verbose)" --> G[_ensure_isaaclab_info_stream_handler\nadd scoped stdout handler]
    F -- "== WARNING\n(default)" --> H[_ensure_isaaclab_info_stream_handler\nadd scoped stdout handler]
    H --> I[root logger setLevel INFO\nso scoped handler receives INFO records]
    F -- "> WARNING\n(ERROR / CRITICAL)" --> J[No scoped handler added\nisaaclab INFO hidden]
    G --> K{carb output in same terminal?}
    K -- Yes --> L[Duplicate isaaclab INFO lines\ncarb via bridge + scoped stdout]
    K -- No --> M[isaaclab INFO visible in terminal only]
    I --> N[Kit bridge handlers at WARNING\nfilter non-isaaclab INFO\nScoped handler passes isaaclab INFO to stdout]
Loading

Reviews (1): Last reviewed commit: "Fix Kit Python info logging" | Re-trigger Greptile

Comment on lines +1225 to +1226
if self._python_logging_level <= logging.INFO:
AppLauncher._ensure_isaaclab_info_stream_handler()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Duplicate isaaclab INFO output when --info or --verbose is passed

When _python_logging_level <= logging.INFO, _apply_python_logging_level sets Kit's bridge handlers to INFO/DEBUG, so they will forward isaaclab INFO records to carb. Simultaneously, _ensure_isaaclab_info_stream_handler installs an additional stdout handler for those same records. In environments where carb's output surfaces in the same terminal as Python's stdout (the common headless console case), every isaaclab INFO line will print twice — once via carb's routing from Kit's bridge, once via the dedicated [INFO]: … stream handler. The stated test plan only exercises the default (no-flag) path, leaving this path unverified.

Comment on lines +1224 to +1231
AppLauncher._apply_python_logging_level(self._python_logging_level)
if self._python_logging_level <= logging.INFO:
AppLauncher._ensure_isaaclab_info_stream_handler()
elif self._python_logging_level == logging.WARNING:
AppLauncher._ensure_isaaclab_info_stream_handler()
# Let Isaac Lab INFO records reach the scoped handler while the other root
# handlers remain at WARNING.
logging.getLogger().setLevel(logging.INFO)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Root logger level set to WARNING then immediately overridden to INFO

_apply_python_logging_level(WARNING) sets the root logger to WARNING, but the very next statement in this branch unconditionally sets it back to INFO. The root-level assignment inside _apply_python_logging_level has no lasting effect here — only the per-handler assignments matter. Consider documenting clearly why the root must end up at INFO even when the user-facing level is WARNING.

Suggested change
AppLauncher._apply_python_logging_level(self._python_logging_level)
if self._python_logging_level <= logging.INFO:
AppLauncher._ensure_isaaclab_info_stream_handler()
elif self._python_logging_level == logging.WARNING:
AppLauncher._ensure_isaaclab_info_stream_handler()
# Let Isaac Lab INFO records reach the scoped handler while the other root
# handlers remain at WARNING.
logging.getLogger().setLevel(logging.INFO)
AppLauncher._apply_python_logging_level(self._python_logging_level)
if self._python_logging_level <= logging.INFO:
AppLauncher._ensure_isaaclab_info_stream_handler()
elif self._python_logging_level == logging.WARNING:
AppLauncher._ensure_isaaclab_info_stream_handler()
# _apply_python_logging_level set all handlers to WARNING; lower only the root
# logger to INFO so that isaaclab INFO records can reach the scoped handler
# while every other handler still filters them out.
logging.getLogger().setLevel(logging.INFO)
# Note: the root.setLevel(WARNING) inside _apply_python_logging_level is
# intentionally overridden here — only handler-level filtering is needed.

@kellyguo11 kellyguo11 merged commit 669082f into isaac-sim:develop May 27, 2026
36 of 37 checks passed
kellyguo11 added a commit that referenced this pull request May 28, 2026
… locomanip quaternion, deformable demo, IK, benchmark scripts (#5816)

# Description

Cherry pick following PRs from develop:

- #5779 
- #5760
- #5791
- #5810 
- #5811
- #5812 
- #5754 
- #5802 
- #5803 
- #5782
- #5804 
- #5744 
- #5775 
- #5784

---------

Signed-off-by: Kelly Guo <kellyg@nvidia.com>
Co-authored-by: John <jaybdub@users.noreply.github.com>
Co-authored-by: myurasov-nv <168484206+myurasov-nv@users.noreply.github.com>
Co-authored-by: Antoine RICHARD <antoiner@nvidia.com>
Co-authored-by: Mike Yan Michelis <46975745+mmichelis@users.noreply.github.com>
Co-authored-by: hujc <jichuanh@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants