From 521f94706a08236ad43850e307cb2320da9fc739 Mon Sep 17 00:00:00 2001 From: g41797 Date: Thu, 10 Oct 2024 08:39:29 +0300 Subject: [PATCH] Update README --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 56d9333..e7068ca 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Let's see what this message consist of: -#### Priority +### Priority > Priority = **Facility** * 8 + *Severity* @@ -94,11 +94,11 @@ Usually zig process will use [.local0-.local7] facilities |7| .debug | debug-level messages | -#### Quiz +### Quiz What are *Facility* and *Severity* of **"Hello, Zig!"** message? -#### For leisure time +### For leisure time - [What is Syslog?](https://www.auvik.com/franklyit/blog/what-is-syslog/) - [syslog-ng Open Source Edition](https://www.syslog-ng.com/products/open-source-log-management/) @@ -107,5 +107,31 @@ What are *Facility* and *Severity* of **"Hello, Zig!"** message? - [Kafka syslog connector](https://www.confluent.io/hub/confluentinc/kafka-connect-syslog) - [Nats syslog connector](https://github.com/g41797/syslog2nats) +## Installation + +Add *syslog* to build.zig.zon: +```bach +zig fetch --save=syslog git+https://github.com/g41797/syslog +``` + +Add *syslog* to build.zig: +```zig + const syslog = b.dependency("syslog", .{ + .target = target, + .optimize = optimize, + }); + + const lib = b.addStaticLibrary(..); + lib.root_module.addImport("syslog", syslog.module("syslog")); + + const lib_unit_tests = b.addTest(...); + lib_unit_tests.root_module.addImport("syslog", syslog.module("syslog")); +``` + +Import *syslog*: +```zig +const syslog = @import("syslog"); +``` + ![](_logo/CLion_icon.png)