| ... | @@ -149,9 +149,15 @@ pub fn defaultLog( | ... | @@ -149,9 +149,15 @@ pub fn defaultLog( |
| 149 | const level_txt = comptime message_level.asText(); | 149 | const level_txt = comptime message_level.asText(); |
| 150 | const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): "; | 150 | const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): "; |
| 151 | const stderr = std.io.getStdErr().writer(); | 151 | const stderr = std.io.getStdErr().writer(); |
| | 152 | var bw = std.io.bufferedWriter(stderr); |
| | 153 | const writer = bw.writer(); |
| | 154 | |
| 152 | std.debug.getStderrMutex().lock(); | 155 | std.debug.getStderrMutex().lock(); |
| 153 | defer std.debug.getStderrMutex().unlock(); | 156 | defer std.debug.getStderrMutex().unlock(); |
| 154 | nosuspend stderr.print(level_txt ++ prefix2 ++ format ++ "\n", args) catch return; | 157 | nosuspend { |
| | 158 | writer.print(level_txt ++ prefix2 ++ format ++ "\n", args) catch return; |
| | 159 | bw.flush() catch return; |
| | 160 | } |
| 155 | } | 161 | } |
| 156 | | 162 | |
| 157 | /// Returns a scoped logging namespace that logs all messages using the scope | 163 | /// Returns a scoped logging namespace that logs all messages using the scope |