An open API service indexing awesome lists of open source software.

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

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", .{});
```