std: make options a struct instance instead of a namespace
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user