Skip to content

Reduce noisy logs from third-party libraries without changing behavior.#4950

Open
klakhi wants to merge 1 commit intoisaac-sim:developfrom
klakhi:klakhi/reduce_noise_play_rsl_rl
Open

Reduce noisy logs from third-party libraries without changing behavior.#4950
klakhi wants to merge 1 commit intoisaac-sim:developfrom
klakhi:klakhi/reduce_noise_play_rsl_rl

Conversation

@klakhi
Copy link
Contributor

@klakhi klakhi commented Mar 11, 2026

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

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
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@klakhi klakhi requested a review from ooctipus as a code owner March 11, 2026 19:44
@github-actions github-actions bot added the isaac-lab Related to Isaac Lab team label Mar 11, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR reduces noisy console output during policy play by suppressing DEBUG-level chatter from onnxscript/onnx_ir and WARNING-level messages from isaaclab_physx. The changes are limited to scripts/reinforcement_learning/rsl_rl/play.py and have no runtime behavior impact outside of log verbosity.

Key observations:

  • The import logging statement is added after import time, breaking the alphabetical ordering already established by the rest of the stdlib imports in the file (and followed in the sibling train.py).
  • Suppressing isaaclab_physx at logging.ERROR silences all warnings from that first-party namespace, not only the specific repetitive "body count mismatch" messages. This could hide future diagnostic warnings added to that library.
  • The analogous fix is absent from train.py and other RL framework play scripts (rl_games, skrl, sb3, rlinf), which would exhibit the same noisy output during their own play/train runs.

Confidence Score: 4/5

  • This PR is safe to merge; the changes are purely cosmetic (log verbosity) with no impact on simulation behavior.
  • The diff is small and well-scoped. The only concerns are a minor import ordering issue and the broad suppression of all isaaclab_physx warnings (instead of filtering just the known-noisy message), both of which are style/best-practice issues rather than correctness bugs.
  • No files require special attention, though scripts/reinforcement_learning/rsl_rl/play.py warrants a quick look at the isaaclab_physx log level decision.

Important Files Changed

Filename Overview
scripts/reinforcement_learning/rsl_rl/play.py Adds module-level log suppression for onnxscript, onnx_ir (DEBUG→INFO), and isaaclab_physx (WARNING→ERROR); import logging is placed out of alphabetical order, and the isaaclab_physx suppression is broader than necessary.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[play.py starts] --> B[Parse CLI args]
    B --> C[Set log levels at module scope]
    C --> D1[onnxscript to INFO]
    C --> D2[onnx_ir to INFO]
    C --> D3[isaaclab_physx to ERROR]
    D1 & D2 & D3 --> E[Launch simulation via main]
    E --> F[Load checkpoint and run policy loop]
    F --> G{Log message emitted?}
    G -->|onnxscript or onnx_ir DEBUG| H[Suppressed]
    G -->|isaaclab_physx WARNING| H
    G -->|isaaclab_physx ERROR or higher| I[Shown to user]
    G -->|All other loggers| I
Loading

Last reviewed commit: 86d355a

import os
import sys
import time
import logging
Copy link
Contributor

Choose a reason for hiding this comment

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

Import out of alphabetical order

The import logging statement is placed after import time, but the rest of the stdlib imports in this file follow alphabetical order (argparse, importlib, os, sys, time). logging should appear between importlib and os. The project's train.py already follows this ordering correctly.

Suggested change
import logging
import logging
import os
import sys
import time

(And remove import logging from line 13.)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

# - isaaclab_physx: hide repetitive WARNINGs (e.g., body count mismatch) while keeping errors
logging.getLogger("onnxscript").setLevel(logging.INFO)
logging.getLogger("onnx_ir").setLevel(logging.INFO)
logging.getLogger("isaaclab_physx").setLevel(logging.ERROR)
Copy link
Contributor

Choose a reason for hiding this comment

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

Overly broad suppression of isaaclab_physx warnings

Setting isaaclab_physx to logging.ERROR suppresses all WARNING-level messages from that namespace, not just the repetitive "body count mismatch" ones mentioned in the comment. isaaclab_physx is a first-party Isaac Lab library, and future warnings added to it (e.g., deprecation notices, configuration issues, or new diagnostics) will be silently dropped for any user running this play script.

A more targeted approach would be to use a logging.Filter to suppress only the known-noisy messages, while allowing other WARNING-level output through:

class _BodyCountFilter(logging.Filter):
    def filter(self, record):
        return "body count mismatch" not in record.getMessage()

logging.getLogger("isaaclab_physx").addFilter(_BodyCountFilter())

Alternatively, if the intent is intentional and the warning is truly always noise during play, a brief comment explaining why all warnings from this namespace are safe to discard would help future maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant