https://github.com/annekitsune/anne_log
Simple scoped zig file logger
https://github.com/annekitsune/anne_log
zig zig-package
Last synced: 9 months ago
JSON representation
Simple scoped zig file logger
- Host: GitHub
- URL: https://github.com/annekitsune/anne_log
- Owner: AnneKitsune
- License: agpl-3.0
- Created: 2025-08-24T03:04:23.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-24T03:09:18.000Z (10 months ago)
- Last Synced: 2025-10-01T22:33:20.774Z (9 months ago)
- Topics: zig, zig-package
- Language: Zig
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple zig logging library to file
This is a minimalist scoped logger. It is opiniated in design:
1. We only support file output.
2. We only provide `info` and `err`. Info is for general information and what would be considered "warnings". It is also for *recoverable* errors. Err is for errors where unexpected loss of functionality occurs.
3. The output file is in tsv-like format. The exception is that some messages are multiline (like stacktraces for errors).
### Usage
1. Add to your build.zig.zon.
2. Add the module to your module.
3. Link against the library.
4. Use the following code example as a template:
```zig
var logger = try Log.init(.{});
defer logger.deinit();
const root_scope = logger.scope("root");
root_scope.info("abc", .{});
root_scope.err("some mean error", .{});
```