Skip to content

Conversation

@AntoineRichard
Copy link
Collaborator

Description

Increase usage of Logging over Prints.

Type of change

  • New feature (non-breaking change which adds functionality)

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

@github-actions github-actions bot added the isaac-lab Related to Isaac Lab team label Dec 12, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 12, 2025

Greptile Overview

Greptile Summary

This PR systematically replaces print() statements with Python's standard logging module across the IsaacLab codebase, improving log management and configurability.

Key Changes:

  • Converted informational prints to logger.info() in environment classes, managers, sensors, and utilities
  • Converted error/warning prints to logger.warning() in exception handlers and validation checks
  • Added import logging and logger = logging.getLogger(__name__) to 9 files
  • Removed debug print statement in newton_manager.py:193
  • Unrelated changes: commented out Anymal-D rough terrain environments and removed camera tasks from benchmark script

Minor Issues:

  • Redundant "WARNING:" prefix in warning message at cloner/utils.py:63
  • Debug log statement left at action_manager.py:304 should be removed or guarded

Confidence Score: 4/5

  • Safe to merge with minor style improvements recommended
  • The logging conversion is well-executed and consistent across the codebase. Two minor style issues were identified (redundant warning prefix and debug log), but these don't affect functionality. The unrelated changes (commented environments, removed benchmark tasks) should be verified as intentional.
  • Pay attention to source/isaaclab/isaaclab/managers/action_manager.py (debug log) and source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/config/anymal_d/__init__.py (verify commented code is intentional)

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/cloner/utils.py 4/5 Converted print warning to logger.warning, minor style issue with redundant prefix
source/isaaclab/isaaclab/envs/direct_rl_env.py 5/5 Cleanly converted all print statements to logger.info
source/isaaclab/isaaclab/envs/manager_based_env.py 5/5 Cleanly converted all print statements to logger.info
source/isaaclab/isaaclab/managers/action_manager.py 4/5 Converted prints to logging, debug log statement should be removed or guarded
source/isaaclab/isaaclab/sim/_impl/newton_manager.py 5/5 Converted all prints to appropriate log levels (info/warning), removed debug print

Sequence Diagram

sequenceDiagram
    participant User
    participant Env as Environment Classes
    participant Mgr as Manager Classes
    participant Sensor as Sensors/Utils
    participant Logger as Python Logger

    Note over User,Logger: Logging Integration Flow

    User->>Env: Initialize Environment
    Env->>Logger: import logging.getLogger(__name__)
    Env->>Logger: logger.info("Base environment info")
    Env->>Logger: logger.info("Scene manager info")
    
    Env->>Mgr: Load Managers
    Mgr->>Logger: import logging.getLogger(__name__)
    Mgr->>Logger: logger.info("Action/Observation Manager")
    Mgr->>Logger: logger.warning("Failed to get descriptor")
    
    Env->>Sensor: Initialize Sensors
    Sensor->>Logger: import logging.getLogger(__name__)
    Sensor->>Logger: logger.info("Contact sensor initialized")
    
    User->>Env: Start Simulation
    Env->>Logger: logger.info("Starting simulation...")
    Env->>Sensor: Setup Newton Manager
    Sensor->>Logger: logger.info("Builder/Model info")
    Sensor->>Logger: logger.warning("Solver convergence issues")
    
    Env->>Logger: logger.info("Completed setup...")
    Logger-->>User: Structured log output
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (2)

  1. source/isaaclab/isaaclab/cloner/utils.py, line 63 (link)

    style: Redundant "WARNING:" prefix in message since logger.warning() already indicates warning level

  2. source/isaaclab/isaaclab/managers/action_manager.py, line 304 (link)

    style: Debug log left in production code - remove or guard with debug flag

14 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

"skrl_cfg_entry_point": f"{agents.__name__}:skrl_rough_ppo_cfg.yaml",
},
)
# gym.register(
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this is commented out?

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.

2 participants