aboutsummaryrefslogtreecommitdiff
path: root/lib/std/log.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-09-26 21:03:38 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-09-26 21:03:38 -0700
commitb6556c944b88726c2bdb34ce72358ade88c5a984 (patch)
tree426cf861f39fb6e250e581588c33496366a1e68c /lib/std/log.zig
parentfe4c348f578903d53c490673b1b1dcf5513ae049 (diff)
downloadzig-b6556c944b88726c2bdb34ce72358ade88c5a984.tar.gz
zig-b6556c944b88726c2bdb34ce72358ade88c5a984.zip
fix another round of regressions in this branch
* std.log: still print error messages in ReleaseSmall builds. - when start code gets an error code from main, it uses std.log.err to report the error. this resulted in a test failure because ReleaseSmall wasn't printing `error: TheErrorCode` when an error was returned from main. But that seems like it should keep working. So I changed the std.log defaults. I plan to follow this up with a proposal to change the names of and reduce the quantity of the log levels. * warning emitted when using -femit-h when using stage1 backend; fatal log message when using -femit-h with self-hosted backend (because the feature is not yet available) * fix double `test-cli` build steps in zig's build.zig * update docgen to use new CLI * translate-c uses `-x c` and generates a temporary basename with a `.h` extension. Otherwise clang reports an error. * --show-builtin implies -fno-emit-bin * restore the compile error for using an extern "c" function without putting -lc on the build line. we have to know about the libc dependency up front. * Fix ReleaseFast and ReleaseSmall getting swapped when passing the value to the stage1 backend. * correct the zig0 CLI usage text. * update test harness code to the new CLI.
Diffstat (limited to 'lib/std/log.zig')
-rw-r--r--lib/std/log.zig8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/std/log.zig b/lib/std/log.zig
index bc83e6053d..0cc2b54452 100644
--- a/lib/std/log.zig
+++ b/lib/std/log.zig
@@ -101,14 +101,12 @@ pub const Level = enum {
debug,
};
-/// The default log level is based on build mode. Note that in ReleaseSmall
-/// builds the default level is emerg but no messages will be stored/logged
-/// by the default logger to save space.
+/// The default log level is based on build mode.
pub const default_level: Level = switch (builtin.mode) {
.Debug => .debug,
.ReleaseSafe => .notice,
.ReleaseFast => .err,
- .ReleaseSmall => .emerg,
+ .ReleaseSmall => .err,
};
/// The current log level. This is set to root.log_level if present, otherwise
@@ -131,7 +129,7 @@ fn log(
// On freestanding one must provide a log function; we do not have
// any I/O configured.
return;
- } else if (builtin.mode != .ReleaseSmall) {
+ } else {
const level_txt = switch (message_level) {
.emerg => "emergency",
.alert => "alert",