authorgravatar for heidezomp@protonmail.comheidezomp <heidezomp@protonmail.com> 2020-07-22 23:26:41+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-22 22:08:08+00:00
log32a6759a7ae532742198bb1d257250f196916a75
tree2b147eae8dbf2e310b16cad6b42259bcb3561736
parenta6626802f9ee080616064aff0bc3f0f2709488c3

Fix std.log example to make the log handler print the newline

Follow up from #5910

1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/log.zig+4-4
......@@ -40,15 +40,15 @@ const root = @import("root");
4040//! const held = std.debug.getStderrMutex().acquire();
4141//! defer held.release();
4242//! const stderr = std.io.getStdErr().writer();
43//! nosuspend stderr.print(prefix ++ format, args) catch return;
43//! nosuspend stderr.print(prefix ++ format ++ "\n", args) catch return;
4444//! }
4545//!
4646//! pub fn main() void {
4747//! // Won't be printed as log_level is .warn
48//! std.log.info(.my_project, "Starting up.\n", .{});
49//! std.log.err(.nice_library, "Something went very wrong, sorry.\n", .{});
48//! std.log.info(.my_project, "Starting up.", .{});
49//! std.log.err(.nice_library, "Something went very wrong, sorry.", .{});
5050//! // Won't be printed as it gets filtered out by our log function
51//! std.log.err(.lib_that_logs_too_much, "Added 1 + 1\n", .{});
51//! std.log.err(.lib_that_logs_too_much, "Added 1 + 1", .{});
5252//! }
5353//! ```
5454//! Which produces the following output: