| ... | @@ -40,15 +40,15 @@ const root = @import("root"); | ... | @@ -40,15 +40,15 @@ const root = @import("root"); |
| 40 | //! const held = std.debug.getStderrMutex().acquire(); | 40 | //! const held = std.debug.getStderrMutex().acquire(); |
| 41 | //! defer held.release(); | 41 | //! defer held.release(); |
| 42 | //! const stderr = std.io.getStdErr().writer(); | 42 | //! 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; |
| 44 | //! } | 44 | //! } |
| 45 | //! | 45 | //! |
| 46 | //! pub fn main() void { | 46 | //! pub fn main() void { |
| 47 | //! // Won't be printed as log_level is .warn | 47 | //! // Won't be printed as log_level is .warn |
| 48 | //! std.log.info(.my_project, "Starting up.\n", .{}); | 48 | //! std.log.info(.my_project, "Starting up.", .{}); |
| 49 | //! std.log.err(.nice_library, "Something went very wrong, sorry.\n", .{}); | 49 | //! std.log.err(.nice_library, "Something went very wrong, sorry.", .{}); |
| 50 | //! // Won't be printed as it gets filtered out by our log function | 50 | //! // 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", .{}); |
| 52 | //! } | 52 | //! } |
| 53 | //! ``` | 53 | //! ``` |
| 54 | //! Which produces the following output: | 54 | //! Which produces the following output: |