Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabling/redirecting sc2 logging #109

Open
ElieAljalbout opened this issue Feb 15, 2023 · 1 comment
Open

disabling/redirecting sc2 logging #109

ElieAljalbout opened this issue Feb 15, 2023 · 1 comment

Comments

@ElieAljalbout
Copy link

is it somehow possible to disable or at least redirect all the logging outputs so that they don't dominate the terminal? I'm talking about prints such as the following:

Configure: feature layer interface disabled
Configure: score interface disabled
Configure: render interface disabled
Launching next game.
Next launch phase started: 2
Next launch phase started: 3
Next launch phase started: 4
Next launch phase started: 5
Next launch phase started: 6
Next launch phase started: 7

@Joy1112
Copy link

Joy1112 commented Apr 19, 2023

Same problem. When i run multiple smac instances, this could be really annoying.

I struggled to find these outputs are caused by package pysc2, and there was already an issue about it.

For me, i update the pysc2.lib.sc_process.StarcraftProcess()._launch() as i proposed in the issue above.
Meanwhile, I also change the source code of smac in StarCraft2Env()._launch() to disable the logging info:

self._sc2_proc = self._run_config.start(
    window_size=self.window_size, want_rgb=False, stderr=subprocess.DEVNULL
)

Additionally, if one wants to retrace these outputs, I found pysc2 already supports strace.
The only thing is to set flags.sc2_strace=True defined at sc_process.py.

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

No branches or pull requests

2 participants