Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gandalf-le-dev/zigbeam
A std.log compliant colored logging library for Zig
https://github.com/gandalf-le-dev/zigbeam
colored-logging log logging structured-logging zig
Last synced: about 1 month ago
JSON representation
A std.log compliant colored logging library for Zig
- Host: GitHub
- URL: https://github.com/gandalf-le-dev/zigbeam
- Owner: Gandalf-Le-Dev
- License: mit
- Created: 2024-09-12T14:14:01.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-31T22:17:35.000Z (3 months ago)
- Last Synced: 2024-12-09T23:21:07.875Z (about 1 month ago)
- Topics: colored-logging, log, logging, structured-logging, zig
- Language: Zig
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zigbeam
Structured Logging library for the Zig language
## How to use
1. You can fetch Zigbeam with this command
```cmd
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:
```zig
const zigbeam_dep = b.dependency("zigbeam", .{});
const zigbeam_mod = zigbeam_dep.module("zigbeam");
exe.root_module.addImport("zigbeam", zigbeam_mod);
```3. You can now use Zigbeam in your project. Here is an example:
```zig
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!");
}
```