Skip to content

A std.log compliant colored logging library for Zig

License

Notifications You must be signed in to change notification settings

Gandalf-Le-Dev/zigbeam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zigbeam

Structured Logging library for the Zig language

How to use

  1. 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.

  2. 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);
  1. 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!");
}

About

A std.log compliant colored logging library for Zig

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages