From b80004ab6b9721c879d2c220dfa5277ea715a3b2 Mon Sep 17 00:00:00 2001 From: g41797 Date: Wed, 9 Oct 2024 17:51:47 +0300 Subject: [PATCH] Prepare documentation --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 70a99a1..f81ee4c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,50 @@ # Zig syslog client -[![CI](https://github.com/g41797/syslog/actions/workflows/ci.yml/badge.svg)](https://github.com/g41797/syslog/actions/workflows/ci.yml) +[![CI](https://github.com/g41797/syslog/actions/workflows/ci.yml/badge.svg)](https://github.com/g41797/syslog/actions/workflows/ci.yml)[![Wiki](https://img.shields.io/badge/Wikipedia-%23000000.svg?style=for-the-badge&logo=wikipedia&logoColor=white)](https://en.wikipedia.org/wiki/Syslog) -WIP + This is a [syslog](https://en.wikipedia.org/wiki/Syslog) client library for Zig. It supports: +- subset of [RFC5424](https://datatracker.ietf.org/doc/html/rfc5424) +- UDP +- TCP + + + + + + +## Hello, Zig! + +When client code calls +```zig + logger.write_info("Hello, Zig!"); +``` + +[syslog client](src/syslog.zig) sends following text message to syslog receiver process: +> +> <190>1 2024-10-09T09:07:11+00:00 BLKF zigprocess 18548 1 - Hello, Zig! +> + + +Let's see what this message consist of: + +| Value | Definition | Description | +|:-----------:| :---: |:-------------------------------------------------------| +| 190 | PRIVAL | Priority | +| 1 | VERSION | Always 1 | +| 2024-10-09T09:07:11+00:00 | TIMESTAMP | FULL-DATE "T" FULL-TIME | +| BLKF | HOSTNAME | Hostname or '-' | +| zigprocess | APP-NAME | Application name provided by caller | +| 18548 | PROCID | Process ID or '-' | +| 1 | MSGID | Message ID - sequential number generated automatically | +| - | STRUCTURED-DATA | Always '-' | +| Hello, Zig! | MSG | Message | + + + + + + + ![](_logo/CLion_icon.png)