Declaraciones públicas de src/log.zig (zkit (SDK consumido)).
apps/docs/generated/zig/zkit.jsonPágina generada desde
zkit@zkit-0.0.0-_fk2iAa4BQCqGFKJeeY9WvMQClX5kiZQ2iOZrVsxVyyN (src/root.zig). No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
Centralized logging configuration.
Usage:
const log = @import("log").scoped;
const cli_log = log("cli");
const diff_log = log("diff");
cli_log.info("Watching: {s}", .{path});
diff_log.debug("Diff computed {d} edits", .{edits.len});log.std_optionsconst · línea 17
pub const std_options: std.Options = .{ .log_level = .err, }Suppress info/warn/debug logs in dylib builds (only err and above). This is read at compile time by std.log.logEnabled.
log.scopedfn · línea 34
pub fn scoped(comptime name: []const u8) typeHelper for scoped logging with consistent interface.
Returns a struct with scoped log methods for the given namespace.
const log = @import("log").scoped;
const my_log = log("my_module");
my_log.debug("Debug info: {}", .{value});
my_log.info("Info message: {}", .{data});
my_log.warn("Warning: {}", .{warning});
my_log.err("Error: {}", .{error});log.scoped.debugfn · línea 36
pub fn debug(comptime fmt: []const u8, args: anytype) voidSin ///.
log.scoped.infofn · línea 39
pub fn info(comptime fmt: []const u8, args: anytype) voidSin ///.
log.scoped.warnfn · línea 42
pub fn warn(comptime fmt: []const u8, args: anytype) voidSin ///.
log.scoped.errfn · línea 45
pub fn err(comptime fmt: []const u8, args: anytype) voidSin ///.