mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
Improve logging
1 - Make log_level a runtime option (not a build-time) 2 - Make log_format a runtime option 3 - In Debug mode, allow for log scope filtering Improve the general usability of scopes. Previously, the scope was more or less based on the file that the log was in. Now they are more logically grouped. Consider the case where you want to silence HTTP request information, previously you'd have to filter out the `page`, `xhr` and `http_client` scopes, but that would also elimiate other page, xhr and http_client logs. Now, you can just filter out the `http` scope.
This commit is contained in:
15
build.zig
15
build.zig
@@ -44,21 +44,6 @@ pub fn build(b: *std.Build) !void {
|
||||
b.option([]const u8, "git_commit", "Current git commit") orelse "dev",
|
||||
);
|
||||
|
||||
{
|
||||
const log = @import("src/log.zig");
|
||||
opts.addOption(
|
||||
log.Level,
|
||||
"log_level",
|
||||
b.option(log.Level, "log_level", "The log level") orelse .info,
|
||||
);
|
||||
}
|
||||
|
||||
opts.addOption(
|
||||
bool,
|
||||
"log_unknown_properties",
|
||||
b.option(bool, "log_unknown_properties", "Log access to unknown properties") orelse false,
|
||||
);
|
||||
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user