Skip to content

Improve log output and environment initialization summary - #527

Merged
yuecideng merged 4 commits into
mainfrom
enhance/log-output-format
Aug 20, 2026
Merged

Improve log output and environment initialization summary#527
yuecideng merged 4 commits into
mainfrom
enhance/log-output-format

Conversation

@yuecideng

@yuecidengyuecideng commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

This PR improves EmbodiChain console output and environment startup diagnostics:

  • format log timestamps as UTC date/time with millisecond precision;
  • align log levels and separate fields with clear column delimiters;
  • apply defaults for all four levels (DEBUG cyan, INFO green, WARNING yellow, and ERROR red);
  • preserve per-call color overrides and allow color=None to disable coloring;
  • replace the legacy tabbed environment messages with a compact tree summary;
  • include runtime configuration, timing, concise Gym metadata, robot, and sensor information;
  • list every built-in manager, disabled managers, and all active functors grouped by mode;
  • defer the EmbodiedEnv summary until managers and recording buffers are initialized;
  • emit each summary row as a separate log record so every row retains timestamp, level, and component columns.

Representative output:

2026-08-19 15:02:36.123 UTC │ INFO │ EmbodiChain │ ╭─ Environment initialized: ExampleEnv
2026-08-19 15:02:36.124 UTC │ INFO │ EmbodiChain │ ├─ Runtime
2026-08-19 15:02:36.125 UTC │ INFO │ EmbodiChain │ │ Device cuda:0
2026-08-19 15:02:36.126 UTC │ INFO │ EmbodiChain │ ├─ Managers (4/5 active, 8 functors)
2026-08-19 15:02:36.127 UTC │ INFO │ EmbodiChain │ │ EventManager 3 functors
2026-08-19 15:02:36.128 UTC │ INFO │ EmbodiChain │ │ reset reset_robot, randomize_objects
2026-08-19 15:02:36.129 UTC │ INFO │ EmbodiChain │ ╰─ Ready

Dependencies: none. Issue: N/A.

Type of change

  • Enhancement (non-breaking change which improves existing functionality)

Screenshots

Not applicable; representative terminal output is included above.

Validation

  • black --check --diff --color ./ — 674 files unchanged
  • pytest tests/utils/test_logger.py -v — 10 passed
  • pytest tests/gym/envs -m "not requires_sim" -q — 287 passed, 1 skipped, 22 deselected
  • pytest tests -q — 1594 passed, 107 skipped, 34 deselected

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation — not required for this terminal-output enhancement.
  • I have added tests that prove the enhancement works.
  • Dependencies have been updated, if applicable — no dependency changes were needed.

@yuecidengyuecideng added the enhancement New feature or request label Aug 19, 2026
@greptile-apps

greptile-appsBot commented Aug 19, 2026

Copy link
Copy Markdown

Greptile Summary

The PR modernizes console logging and replaces legacy environment startup messages with a structured initialization summary.

  • Adds UTC timestamps, aligned log columns, level-specific colors, and per-call color control.
  • Reports runtime, timing, metadata, robot, sensor, manager, and functor details after initialization completes.
  • Adds focused tests for logger formatting and initialization-summary contents.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

FilenameOverview
embodichain/lab/gym/envs/base_env.pyReplaces legacy initialization messages with structured runtime, timing, metadata, robot, and sensor summary generation.
embodichain/lab/gym/envs/embodied_env.pyDefers summary output until managers and recording state are initialized, then includes manager and functor details.
embodichain/utils/logger.pyAdds UTC timestamp formatting, aligned columns, default level colors, custom color overrides, and optional plain records.
tests/gym/envs/test_initialization_summary.pyVerifies summary contents, metadata compaction, manager coverage, and logging behavior.
tests/utils/test_logger.pyVerifies timestamp layout, level colors, overrides, prefix omission, and formatted exceptions.

Sequence Diagram

sequenceDiagram
participant Caller
participant EmbodiedEnv
participant Managers
participant Summary
participant Logger
Caller->>EmbodiedEnv: Initialize environment
EmbodiedEnv->>Managers: Initialize managers and recording state
Managers-->>EmbodiedEnv: Initialization complete
EmbodiedEnv->>Summary: Build runtime and manager summary
Summary-->>EmbodiedEnv: Structured summary lines
EmbodiedEnv->>Logger: Emit initialization summary
Loading

Reviews (4): Last reviewed commit: "wip" | Re-trigger Greptile

@yuecidengyuecideng added the gym robot learning env and its related features label Aug 19, 2026
@yuecidengyuecideng changed the title Improve log timestamps and level colorsImprove log output and environment initialization summaryAug 19, 2026
@yuecideng
yuecideng merged commit 12178b3 into mainAug 20, 2026
2 checks passed
@yuecideng
yuecideng deleted the enhance/log-output-format branch August 20, 2026 02:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or requestgymrobot learning env and its related features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@yuecideng