Skip to content

Lightpanda: the headless browser designed for AI and automation

mcp: make logfmt a Config default instead of an override

Adrià Arrufate02c45888d67
diff --git a/src/Config.zig b/src/Config.zig
index 88d9f70b1..9958bde90 100644
--- a/src/Config.zig
+++ b/src/Config.zig
@@ -663,7 +663,10 @@ fn stderrIsTty() bool {
pub fn logFormat(self: *const Config) ?log.Format {
return switch (self.mode) {
- inline .serve, .fetch, .mcp, .agent => |opts| opts.log_format,
+ // The MCP host captures stderr into a log file, where pretty's ANSI
+ // escapes and multi-line entries are noise.
+ .mcp => |opts| opts.log_format orelse .logfmt,
+ inline .serve, .fetch, .agent => |opts| opts.log_format,
else => unreachable,
};
}
diff --git a/src/main.zig b/src/main.zig
index ccb350217..c1c19c984 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -202,8 +202,6 @@ fn run(allocator: Allocator, main_arena: Allocator, proc_args: std.process.Args)
.mcp => |opts| {
log.info(.mcp, "starting server", .{});
- log.opts.format = .logfmt;
-
// --port serves MCP over HTTP instead of stdio. It and --cdp-port
// each run their accept loop on this thread, so they can't combine.
if (opts.port) |port| {