| author | |
| committer | |
| log | 6f17be063d37f5ecd9552479e65428a5c60d9152 |
| tree | ea5072883e66ff72d591637c7e2ebd197b65f503 |
| parent | 81bbefe9b837dc439a68458ca91d522c1c49b96b |
| signature |
2 files changed, 17 insertions(+), 5 deletions(-)
lib/std/log.zig+5-5| ... | ... | @@ -156,11 +156,11 @@ pub fn defaultLog( |
| 156 | 156 | comptime format: []const u8, |
| 157 | 157 | args: anytype, |
| 158 | 158 | ) void { |
| 159 | if (builtin.os.tag == .freestanding) { | |
| 160 | // On freestanding one must provide a log function; we do not have | |
| 161 | // any I/O configured. | |
| 162 | return; | |
| 163 | } | |
| 159 | if (builtin.os.tag == .freestanding) | |
| 160 | @compileError( | |
| 161 | \\freestanding targets do not have I/O configured; | |
| 162 | \\please provide at least an empty `log` function declaration | |
| 163 | ); | |
| 164 | 164 | |
| 165 | 165 | const level_txt = comptime message_level.asText(); |
| 166 | 166 | const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): "; |
test/standalone/issue_7030/main.zig+12| ... | ... | @@ -1,5 +1,17 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | pub fn log( | |
| 4 | comptime message_level: std.log.Level, | |
| 5 | comptime scope: @Type(.EnumLiteral), | |
| 6 | comptime format: []const u8, | |
| 7 | args: anytype, | |
| 8 | ) void { | |
| 9 | _ = message_level; | |
| 10 | _ = scope; | |
| 11 | _ = format; | |
| 12 | _ = args; | |
| 13 | } | |
| 14 | ||
| 3 | 15 | pub fn main() anyerror!void { |
| 4 | 16 | std.log.info("All your codebase are belong to us.", .{}); |
| 5 | 17 | } |