Skip to content

Do not configure application root logging on dm_control import - #566

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/314-preserve-root-logging-config-20261011
Open

sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/314-preserve-root-logging-config-20261011

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #314.

Summary

  • Avoid Abseil's implicit logging.basicConfig call during import-time OpenGL backend selection and MuJoCo bindings initialization.
  • Use named standard-library loggers for those informational status messages, without installing a root logger handler.
  • Preserve the caller's ability to configure logging.basicConfig after importing dm_control.mjcf, and avoid changing existing configured handlers.
  • Add fresh-interpreter subprocess regression tests for both scenarios.

Verification

  • Reproduced the problem on unchanged upstream main: importing dm_control.mjcf installs a root StreamHandler and prevents a later logging.basicConfig from applying the application's desired format.
  • With this change the import leaves the root logger without handlers, and the user's format is applied correctly.
  • 55 tests and 2 subtests passed across the new import logging tests, renderer base tests and PyMJCF element tests.
  • Ruff selected checks (E4,E7,E9,F except existing F401 reexports), Python compilation and git diff --check passed.
  • Imported against the local MuJoCo 3.15 Python runtime; no live GPU rendering was tested.

This change is limited to logging during module initialization and does not change runtime MuJoCo rendering behavior.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python logging altered on import

1 participant