Skip to content

Commit d2aee98

Browse files
committed
Fix logger
1 parent b6fc735 commit d2aee98

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/main.zig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
const std = @import("std");
22

3+
pub const std_options: std.Options = .{
4+
.log_level = .info,
5+
};
6+
37
const Allocator = std.mem.Allocator;
48

59
const RunRequest = struct {
@@ -43,6 +47,7 @@ pub fn main() !void {
4347
const output_max = resolveOutputMax(allocator);
4448
const debug_enabled = resolveDebugEnabled(allocator);
4549
const runner_cmd = try resolveRunnerCmd(allocator);
50+
defer runner_cmd.deinit(allocator);
4651
var state = ServerState.init(allow_shutdown, run_concurrency, input_max, output_max, debug_enabled, runner_cmd);
4752

4853
try serve(allocator, port, &state);
@@ -191,6 +196,11 @@ fn resolveDebugEnabled(allocator: Allocator) bool {
191196
const RunnerCmd = struct {
192197
raw: []const u8,
193198
argv: []const []const u8,
199+
200+
fn deinit(self: RunnerCmd, allocator: Allocator) void {
201+
allocator.free(self.raw);
202+
allocator.free(self.argv);
203+
}
194204
};
195205

196206
fn resolveRunnerCmd(allocator: Allocator) !RunnerCmd {

src/test.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ fn startServer(allocator: std.mem.Allocator, port: u16, options: ServerOptions)
348348

349349
var child = std.process.Child.init(&[_][]const u8{bin_path}, allocator);
350350
child.stdin_behavior = .Ignore;
351-
child.stdout_behavior = .Pipe;
352-
child.stderr_behavior = .Pipe;
351+
child.stdout_behavior = .Inherit;
352+
child.stderr_behavior = .Inherit;
353353
child.cwd = ".";
354354
child.env_map = &env;
355355
try child.spawn();

0 commit comments

Comments
 (0)