Skip to content

Lightpanda: the headless browser designed for AI and automation

ops: Add "note" log level for CDP "server running" message

Karl Seguin655523c12afb
diff --git a/src/Server.zig b/src/Server.zig
index 43b1a2bc9..ca4cd74ac 100644
--- a/src/Server.zig
+++ b/src/Server.zig
@@ -57,7 +57,7 @@ pub fn init(app: *App, address: net.Address) !*Server {
// Bind first so /json/version can advertise the OS-assigned port (--port 0).
var bound_address = address;
try app.network.bind(&bound_address, self, onAccept);
- log.info(.app, "server running", .{ .address = bound_address });
+ log.note(.app, "server running", .{ .address = bound_address });
self.json_version_response = try buildJSONVersionResponse(app, bound_address.getPort());
return self;
diff --git a/src/log.zig b/src/log.zig
index 94906e57f..e1119c3d7 100644
--- a/src/log.zig
+++ b/src/log.zig
@@ -89,6 +89,7 @@ pub const Level = enum {
warn,
err,
fatal,
+ note,
};
pub const Format = enum {
@@ -116,6 +117,10 @@ pub fn fatal(scope: Scope, msg: []const u8, data: anytype) void {
log(scope, .fatal, msg, data);
}
+pub fn note(scope: Scope, msg: []const u8, data: anytype) void {
+ log(scope, .note, msg, data);
+}
+
pub fn log(scope: Scope, level: Level, msg: []const u8, data: anytype) void {
if (enabled(scope, level) == false) {
return;
@@ -229,6 +234,7 @@ fn logPrettyPrefix(scope: Scope, level: Level, msg: []const u8, writer: *std.Io.
.warn => "\x1b[0;33mWARN\x1b[0m ",
.err => "\x1b[0;31mERROR ",
.fatal => "\x1b[0;35mFATAL ",
+ .note => "\x1b[0;32mNOTE\x1b[0m ",
});
}