mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Fix new log function options for zig
This commit is contained in:
@ -142,6 +142,7 @@ pub fn tracy_enabled() bool {
|
||||
return options.tracy_enabled;
|
||||
}
|
||||
|
||||
pub const std_options = struct {
|
||||
// Our log level is always at least info in every build mode.
|
||||
pub const log_level: std.log.Level = switch (builtin.mode) {
|
||||
.Debug => .debug,
|
||||
@ -149,7 +150,7 @@ pub const log_level: std.log.Level = switch (builtin.mode) {
|
||||
};
|
||||
|
||||
// The function std.log will call.
|
||||
pub fn log(
|
||||
pub fn logFn(
|
||||
comptime level: std.log.Level,
|
||||
comptime scope: @TypeOf(.EnumLiteral),
|
||||
comptime format: []const u8,
|
||||
@ -187,6 +188,7 @@ pub fn log(
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
nosuspend stderr.print(level_txt ++ prefix ++ format ++ "\n", args) catch return;
|
||||
}
|
||||
};
|
||||
|
||||
fn glfwErrorCallback(code: glfw.Error, desc: [:0]const u8) void {
|
||||
std.log.warn("glfw error={} message={s}", .{ code, desc });
|
||||
|
@ -4,12 +4,12 @@ const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
|
||||
pub usingnamespace @import("os/wasm.zig");
|
||||
pub usingnamespace @import("os/wasm/log.zig");
|
||||
pub usingnamespace @import("font/main.zig");
|
||||
pub usingnamespace @import("terminal/main.zig");
|
||||
pub usingnamespace @import("config.zig").Wasm;
|
||||
pub usingnamespace @import("App.zig").Wasm;
|
||||
|
||||
pub const std_options = struct {
|
||||
// Set our log level. We try to get as much logging as possible but in
|
||||
// ReleaseSmall mode where we're optimizing for space, we elevate the
|
||||
// log level.
|
||||
@ -18,3 +18,7 @@ pub const log_level: std.log.Level = switch (builtin.mode) {
|
||||
.ReleaseSmall => .warn,
|
||||
else => .info,
|
||||
};
|
||||
|
||||
// Set our log function
|
||||
pub const logFn = @import("os/wasm/log.zig").log;
|
||||
};
|
||||
|
Reference in New Issue
Block a user