Skip to content

Commit b80004a

Browse files
committed
Prepare documentation
1 parent c5f2d07 commit b80004a

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,50 @@
22

33
# Zig syslog client
44

5-
[![CI](https://github.com/g41797/syslog/actions/workflows/ci.yml/badge.svg)](https://github.com/g41797/syslog/actions/workflows/ci.yml)
5+
[![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)
66

7-
WIP
87

8+
This is a [syslog](https://en.wikipedia.org/wiki/Syslog) client library for Zig. It supports:
9+
- subset of [RFC5424](https://datatracker.ietf.org/doc/html/rfc5424)
10+
- UDP
11+
- TCP
12+
13+
14+
15+
16+
17+
18+
## Hello, Zig!
19+
20+
When client code calls
21+
```zig
22+
logger.write_info("Hello, Zig!");
23+
```
24+
25+
[syslog client](src/syslog.zig) sends following text message to syslog receiver process:
26+
>
27+
> <190>1 2024-10-09T09:07:11+00:00 BLKF zigprocess 18548 1 - Hello, Zig!
28+
>
29+
30+
31+
Let's see what this message consist of:
32+
33+
| Value | Definition | Description |
34+
|:-----------:| :---: |:-------------------------------------------------------|
35+
| 190 | PRIVAL | Priority |
36+
| 1 | VERSION | Always 1 |
37+
| 2024-10-09T09:07:11+00:00 | TIMESTAMP | FULL-DATE "T" FULL-TIME |
38+
| BLKF | HOSTNAME | Hostname or '-' |
39+
| zigprocess | APP-NAME | Application name provided by caller |
40+
| 18548 | PROCID | Process ID or '-' |
41+
| 1 | MSGID | Message ID - sequential number generated automatically |
42+
| - | STRUCTURED-DATA | Always '-' |
43+
| Hello, Zig! | MSG | Message |
44+
45+
46+
47+
48+
49+
50+
951
![](_logo/CLion_icon.png)

0 commit comments

Comments
 (0)