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

warnings go to stdout, not stderr #179

Open
lunarpapillo opened this issue Feb 14, 2019 · 6 comments · Fixed by #873
Open

warnings go to stdout, not stderr #179

lunarpapillo opened this issue Feb 14, 2019 · 6 comments · Fixed by #873
Labels
bug Something isn't working P3

Comments

@lunarpapillo
Copy link
Contributor

The WARNING line was issued to stdout. I'd expect it to go to stderr.

$ /home/papillo/work/LunarG/gfxreconstruct/build/tools/compress/gfxrecon-compress /tmp/resvi/dota2/compress-native-to-LZ4-results/dota2-LZ4.gfxr /tmp/resvi/dota2/compress-LZ4-to-ZLIB-results/dota2-ZLIB.gfxr ZLIB
[gfxrecon] WARNING - Skipping unrecognized file block with type 0
Compression Results:
  Original Size   [Compression:   LZ4] = 304942678324 bytes
  Compressed Size [Compression:  ZLIB] = 259 bytes
  Percent Reduction                    = 100.00%$
@MarkY-LunarG
Copy link
Contributor

This seems like a preference thing, to me. But I'll let @dustin-lunarg weigh in.

@dustin-lunarg dustin-lunarg changed the title toascii warnings go to stdout, not stderr warnings go to stdout, not stderr Feb 21, 2019
@dustin-lunarg dustin-lunarg added the bug Something isn't working label Feb 21, 2019
@andrew-lunarg
Copy link
Contributor

andrew-lunarg commented Sep 16, 2022

This still happens on Linux even though stderr is the default, and is set in settings at the point void Log::LogMessage() is entered. There is a bunch if platform #ifdefing in that function which may be hiding a bug.

Since toascii has a --stdout output option, this is definitely a bug and not a matter of taste for that tool. Logging to stdout when also outputting JSON Lines to stdout makes the mainstream JSON tool jq choke on our output and kill the pipeline that it is in.

@bradgrantham-lunarg Can we raise the priority on this?

@bradgrantham-lunarg
Copy link
Contributor

Can we solve the jq problem temporarily with grep -v '[gfxrecon]' between the toascii output and jq?

@andrew-lunarg
Copy link
Contributor

Can we solve the jq problem temporarily with grep -v '[gfxrecon]' between the toascii output and jq?

Yes for sure. Good point.

@lunarpapillo
Copy link
Contributor Author

Proper function while pipelined is more important than stdout/stderr. Sending all logging to stderr (and documenting such) is acceptable (though this will require minor changes in CI, which currently look for important information - e.g. FPS, for performance tests - in stdout.)

If we're thinking fancy, new switches --log-stdout, --log-stderr, --log-stdout-stderr (INFO and less go to stdout, WARN and higher to stderr), and --log-none could be added to allow the user to direct log output as needed. (Right now, if you specify --log-file, does logging go to just the file, or to the file and stdout?)

But there may be confusion here, if a user using gfxrecon-convert in a pipeline doesn't realize that they probably want --log-stderr or --log-none... and we probably don't want different tools to have different defaults. So maybe just logging to stderr is better.

I'll leave it for the team to decide.

@andrew-lunarg
Copy link
Contributor

But there may be confusion here, if a user using gfxrecon-convert in a pipeline doesn't realize that they probably want --log-stderr or --log-none... and we probably don't want different tools to have different defaults. So maybe just logging to stderr is better.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants