Reduce noisy logs from third-party libraries without changing behavior.#4950
Reduce noisy logs from third-party libraries without changing behavior.#4950klakhi wants to merge 1 commit intoisaac-sim:developfrom
Conversation
Greptile SummaryThis PR reduces noisy console output during policy play by suppressing DEBUG-level chatter from Key observations:
Confidence Score: 4/5
Important Files Changed
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
Last reviewed commit: 86d355a |
| import os | ||
| import sys | ||
| import time | ||
| import logging |
There was a problem hiding this comment.
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.
| 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) |
There was a problem hiding this comment.
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.
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
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there