Farama-Foundation / Arcade-Learning-Environment

The Arcade Learning Environment (ALE) -- a platform for AI research.
GNU General Public License v2.0
2.12k stars 420 forks source link

How to Disable Logging on Gym Environment Initialization? #456

Closed Hamptonjc closed 2 years ago

Hamptonjc commented 2 years ago

I get:

e = gym.make("ALE/Breakout-v5")
A.L.E: Arcade Learning Environment (version 0.7.5+db37282)
[Powered by Stella]

I want:

e = gym.make("ALE/Breakout-v5")

With no logging output.

Seems I need access to the ALEInterface object before I can reduce the logging level.

How can I do this so that I don't get the logged output on gym.make()?

floringogianu commented 2 years ago

I'm doing something along the lines of:

from ale_py import ALEInterface, LoggerMode

ale = ALEInterface()
ale.setLoggerMode(LoggerMode.Error)

Hope this helps!

JesseFarebro commented 2 years ago

Yes, @floringogianu is correct. You can make one slight modification though. setLoggerMode is a class method so you can:

from ale_py import ALEInterface, LoggerMode

ALEInterface.setLoggerMode(LoggerMode.Error)

and you won't get any output when constructing the ALE.