Skip to content

Commit a077415

Browse files
committed
Print zig version on startup
1 parent d7f8582 commit a077415

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/log.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ pub fn logFn(
6868
mutex.lock();
6969
defer mutex.unlock();
7070

71-
stream.reset();
72-
7371
stream.writer().print(
74-
"<" ++ syslog_prefix ++ ">" ++ LOG_PREFIX ++ ": " ++ format ++ "\n",
72+
"<" ++ syslog_prefix ++ ">" ++ LOG_PREFIX ++ ": " ++ format,
7573
args,
7674
) catch {};
7775

78-
file.writeAll(log_buf[0..stream.pos]) catch {};
76+
file.writeAll(stream.getWritten()) catch {};
77+
78+
stream.reset();
7979
}

src/tboot-loader.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const std = @import("std");
22
const posix = std.posix;
33
const epoll_event = std.os.linux.epoll_event;
4+
const builtin = @import("builtin");
45

56
const linux_headers = @import("linux_headers");
67

@@ -324,6 +325,7 @@ pub fn main() !void {
324325
defer device_watch_thread.join();
325326

326327
std.log.info("tinyboot started", .{});
328+
std.log.debug("built with zig version {s}", .{builtin.zig_version_string});
327329

328330
try security.initializeSecurity(arena.allocator());
329331

0 commit comments

Comments
 (0)