-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Reduce noisy logs from third-party libraries without changing behavior. #4950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| import os | ||
| import sys | ||
| import time | ||
| import logging | ||
|
|
||
| import gymnasium as gym | ||
| import torch | ||
|
|
@@ -66,6 +67,13 @@ | |
|
|
||
| sys.argv = [sys.argv[0]] + hydra_args | ||
|
|
||
| # Reduce noisy logs from third-party libraries without changing behavior. | ||
| # - onnxscript / onnx_ir: hide DEBUG converter chatter | ||
| # - 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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overly broad suppression of Setting A more targeted approach would be to use a 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. |
||
|
|
||
| # Check for installed RSL-RL version | ||
| installed_version = metadata.version("rsl-rl-lib") | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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 loggingstatement is placed afterimport time, but the rest of the stdlib imports in this file follow alphabetical order (argparse,importlib,os,sys,time).loggingshould appear betweenimportlibandos. The project'strain.pyalready follows this ordering correctly.(And remove
import loggingfrom 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!