Structured Logging library for the Zig language
-
You can fetch Zigbeam with this command
zig fetch --save=zigbeam git+https://github.com/Gandalf-Le-Dev/zigbeam/#HEAD
It will fetch the master version. If you wish to fetch a specific version, replace
#HEAD
with the commit hash. -
Then in your build.zig you must add:
const zigbeam_dep = b.dependency("zigbeam", .{});
const zigbeam_mod = zigbeam_dep.module("zigbeam");
exe.root_module.addImport("zigbeam", zigbeam_mod);
- You can now use Zigbeam in your project. Here is an example:
const std = @import("std");
const zigbeam = @import("zigbeam");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
var log = try zigbeam.Logger.init(allocator);
defer log.deinit();
try log.info("Zigbeam is working!");
}