std: make options a struct instance instead of a namespace

This commit is contained in:
Veikka Tuominen
2024-01-28 00:30:24 +02:00
parent 776cd673f2
commit 220d3264c9
10 changed files with 47 additions and 108 deletions

View File

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