-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
change the init-exe example to avoid confusion with ReleaseFast and std.log.info #9945
Comments
Only log messages equal to or higher than the log level will be printed and the default log level of release modes is higher than info: Lines 117 to 122 in e851d89
To override this in the main file add However it does make sense to still treat this as an issue as it would make sense to note this in a comment in the file generated by init-exe. As this is definitely unexpected. |
So this is intended behavior? Also i was trying to inspect generated binary using IDA , but for some reason generated PDB files is crashing IDA once its loaded. |
LogLevel doesn't exist so after looking into log.zig i found out that enum is just Level. |
Yes, by default info level log messages are not emited in release modes. It is unfortunate that due to this the template executable produces no output when built non-debug. To improve this there are really only three options:
|
I think it's an overkill to use std.log for a template executable. Maybe we should do something simple, like writing to stdout directly. |
It was decided to log because this is better scaffolding for larger projects. |
If the intent is to remind users to use std.log, then it should be stated in the docs, not in a simple example program that is expected to do something simple. |
To me, a simplest improvement would be to add a comment to the generated source file, saying "log messages with info level would not be emitted in ReleaseFast, if you intended to use stdout to output some processing results, use X (link to example)" (edit): Also, maybe remove [windows] from the issue title? Looks cross-platform to me |
…ild mode As suggested in ziglang#9945 (comment) by @wizzard0. Fixes ziglang#9945.
…ild mode As suggested in ziglang#9945 (comment) by @wizzard0. Fixes ziglang#9945.
…ild mode (#11626) As suggested in #9945 (comment) by @wizzard0. Fixes #9945.
Zig Version
0.9.0-dev.1352+6d6cf5984
Steps to Reproduce
just init simple zig project and build it with -Drelease-fast=true or -Drelease-small=true
Expected Behavior
Produced binary should print
All your codebase are belong to us.
Actual Behavior
It doesn't print anything. Instead it just exits immediately.
The text was updated successfully, but these errors were encountered: