-
Notifications
You must be signed in to change notification settings - Fork 71
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
--stats output can not be redirect #36
Comments
The problem is not with the redirection, is the --stats flag which is not working (at least when I tried the command) If you do a |
Are there any ideas on the reason why the --stats flag isn't working? I've looked and in theory everything looks like it should be working, but clearly it is not. |
Here is the code block that controls the
and here is the code for
In short, when that argument is passed, a coded-in exception is thrown and nothing happens. Compare this with the working code for the
and you can see why this issue exists. |
Your command only redirects # Print stats
if args.stats:
logger.log_stats(sys.stderr) This would explain why your output file remains blank. A simple workaround is to redirect both
Are there any reasons why stats are specifically printed on stderr ? If not, and if you are okay with modifying the source code, a proper fix would be # Print stats
if args.stats:
logger.log_stats(sys.stdout) |
I found out what "stats" actually does. And it works actually fine, however in another way you might think Please Blizz: add this to the documentation! Without investigating the code you will never guess what happens here. Explanation It will then print (to the error stream as observed). Here a shortened example:
That means it is not at all about game stats as displayed in the final screen. Its more about some internal stats of the event parser. I believe it is the number of events and the time it took to process, thats just a guess though. Why is it printed to the error stream? Because it is no content of the actual replay, but generated values which can change (depending on heroprotocol version, in cas of fixes) and are for debugging or optimizing purpose maybe (check if the events processed match the real events in the game). So you can still process the original output of the standard stream. And if really wanted you may get stats from error stream. No big deal. And for most of us pretty useless? |
the following command creates a blank file
py heroprotocol.py --stats "Blackheart's Bay.StormReplay" > output.txt
The text was updated successfully, but these errors were encountered: