You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing dm_control modifies the standard python logging module. As far as I can tell this is done using Google's abseil. Abseil itself already moved away from this behaviour: abseil/abseil-py#99. Can we do this too for dm_control?
so I don't think you're looking at the right thing. Did you see any other evidence of absl logging handlers being installed?
In the example you posted, the new logging handler is a <StreamHandler <stderr> (NOTSET)>, which is the same thing I get if I just call logging.info myself.
I recently noticed this behavior as well. The standard handler <StreamHandler <stderr> (NOTSET)> is added by the first log call (either absl or standard logging). The dm_control code base just happens to log a few messages during start-up. You can see those log messages by setting the absl log level flag or simply like this:
INFO:absl:MUJOCO_GL is not set, so an OpenGL backend will be chosen automatically.
INFO:absl:Successfully imported OpenGL backend: glfw
INFO:absl:MuJoCo library version is: 213
You can still use basicConfig by setting force=True, which will remove any root handlers, i.e. logging.basicConfig(level=logging.INFO, format='[%(name)s] %(message)s', force=True)
Activity
nimrod-gileadi commentedon Jul 1, 2022
What version of absl-py do you have installed?
dm_control requires 0.7.0 or later, but this fix was included in 0.8.0. Do you still see the issue if you manually pip install the latest absl-py?
surgura commentedon Jul 1, 2022
I am running absl 1.1.0.
Currently I am importing mujoco as follows to prevent this issue:
Doing this or not importing mjcf at all solves the issue, so it must be somewhere in there. Thank you for your response.
nimrod-gileadi commentedon Jul 1, 2022
I'm seeing the following behaviour from the standard
logginglibraryso I don't think you're looking at the right thing. Did you see any other evidence of absl logging handlers being installed?
In the example you posted, the new logging handler is a
<StreamHandler <stderr> (NOTSET)>, which is the same thing I get if I just calllogging.infomyself.surgura commentedon Jul 1, 2022
Sorry I should have provided a minimal example. See below:
Running this gives no output. If I remove the import mjcf I do get output.
JeanElsner commentedon Nov 21, 2022
I recently noticed this behavior as well. The standard handler
<StreamHandler <stderr> (NOTSET)>is added by the first log call (either absl or standard logging). The dm_control code base just happens to log a few messages during start-up. You can see those log messages by setting the absl log level flag or simply like this:will print something like
You can still use basicConfig by setting force=True, which will remove any root handlers, i.e.
logging.basicConfig(level=logging.INFO, format='[%(name)s] %(message)s', force=True)