std: collect all options under one namespace

This commit is contained in:
Veikka Tuominen
2023-01-03 19:37:11 +02:00
committed by Andrew Kelley
parent fe2bd9dda8
commit f83834993e
17 changed files with 164 additions and 97 deletions

View File

@@ -440,11 +440,14 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
cases.add("std.log per scope log level override",
\\const std = @import("std");
\\
\\pub const log_level: std.log.Level = .debug;
\\
\\pub const scope_levels = [_]std.log.ScopeLevel{
\\ .{ .scope = .a, .level = .warn },
\\ .{ .scope = .c, .level = .err },
\\pub const std_options = struct {
\\ pub const log_level: std.log.Level = .debug;
\\
\\ pub const log_scope_levels = &[_]std.log.ScopeLevel{
\\ .{ .scope = .a, .level = .warn },
\\ .{ .scope = .c, .level = .err },
\\ };
\\ pub const logFn = log;
\\};
\\
\\const loga = std.log.scoped(.a);
@@ -494,7 +497,10 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
cases.add("std.heap.LoggingAllocator logs to std.log",
\\const std = @import("std");
\\
\\pub const log_level: std.log.Level = .debug;
\\pub const std_options = struct {
\\ pub const log_level: std.log.Level = .debug;
\\ pub const logFn = log;
\\};
\\
\\pub fn main() !void {
\\ var allocator_buf: [10]u8 = undefined;