diff options
author | 2022-11-15 00:13:09 -0800 | |
---|---|---|
committer | 2022-11-15 00:13:09 -0800 | |
commit | c7e3b4aaa6d0ffdcaca3cadd79fe9ef3d96d3ef6 (patch) | |
tree | 95c18a00a89ac0df66bccd9e0559d9eb7205fb08 /src/bunfig.zig | |
parent | 44babb9ce5a4e26fc43b002dedbf194c31331a0e (diff) | |
download | bun-jarred/dump.tar.gz bun-jarred/dump.tar.zst bun-jarred/dump.zip |
wipjarred/dump
Diffstat (limited to 'src/bunfig.zig')
-rw-r--r-- | src/bunfig.zig | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/bunfig.zig b/src/bunfig.zig index d2ca86380..63d673cdc 100644 --- a/src/bunfig.zig +++ b/src/bunfig.zig @@ -104,18 +104,11 @@ pub const Bunfig = struct { fn loadLogLevel(this: *Parser, expr: js_ast.Expr) !void { try this.expect(expr, .e_string); - const Matcher = strings.ExactSizeMatcher(8); - - this.bunfig.log_level = switch (Matcher.match(expr.asString(this.allocator).?)) { - Matcher.case("debug") => Api.MessageLevel.debug, - Matcher.case("error") => Api.MessageLevel.err, - Matcher.case("warn") => Api.MessageLevel.warn, - Matcher.case("info") => Api.MessageLevel.info, - else => { - try this.addError(expr.loc, "Invalid log level, must be one of debug, error, or warn"); - unreachable; - }, + this.ctx.debug.log_level = logger.Log.Level.Map.get(expr.asString(this.allocator).?) orelse { + try this.addError(expr.loc, "Invalid log level, must be one of \"debug\", \"error\", \"warn\", \"info\", \"verbose\""); + unreachable; }; + logger.Log.default_log_level = this.ctx.debug.log_level.?; } pub fn parse(this: *Parser, comptime cmd: Command.Tag) !void { |