Referencia Zigzkit (SDK consumido)

src/log.zig

Declaraciones públicas de src/log.zig (zkit (SDK consumido)).

ImplementadoSin versión del tren todavía· generada desde apps/docs/generated/zig/zkit.json

Página generada desde zkit@zkit-0.0.0-_fk2iAa4BQCqGFKJeeY9WvMQClX5kiZQ2iOZrVsxVyyN (src/root.zig). No se edita a mano: bun run docs:gen la regenera y bun run docs:check falla 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_options

const · 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.scoped

fn · línea 34

pub fn scoped(comptime name: []const u8) type

Helper 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.debug

fn · línea 36

pub fn debug(comptime fmt: []const u8, args: anytype) void

Sin ///.

log.scoped.info

fn · línea 39

pub fn info(comptime fmt: []const u8, args: anytype) void

Sin ///.

log.scoped.warn

fn · línea 42

pub fn warn(comptime fmt: []const u8, args: anytype) void

Sin ///.

log.scoped.err

fn · línea 45

pub fn err(comptime fmt: []const u8, args: anytype) void

Sin ///.