You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Build Commands
6
+
7
+
```bash
8
+
# Build the library
9
+
zig build
10
+
11
+
# Run all tests
12
+
zig build test
13
+
14
+
# Run tests with reference trace (used in CI)
15
+
zig build test -freference-trace --summary all
16
+
```
17
+
18
+
## Architecture
19
+
20
+
This is a Zig syslog client library implementing a subset of RFC5424, supporting UDP and TCP protocols across Linux, macOS, and Windows.
21
+
22
+
### Core Components
23
+
24
+
-**syslog.zig** - Main `Syslog` struct that users interact with. Thread-safe via mutex. Provides `write_*` and `print_*` methods for each severity level, plus filtering capability.
25
+
26
+
-**rfc5424.zig** - `Formatter` that builds RFC5424-compliant messages. Format: `<PRIVAL>1 TIMESTAMP HOSTNAME APP-NAME PROCID MSGID - MSG`. Auto-grows buffer from 512 bytes up to 32KB.
27
+
28
+
-**transport.zig** - `Sender` wraps zig-network for UDP/TCP connectivity. Handles connection lifecycle and data transmission.
29
+
30
+
-**application.zig** - `Application` stores app metadata (name, facility, hostname, process ID). Hostname retrieved from environment on Windows/Linux, otherwise "-".
31
+
32
+
-**timestamp.zig** - RFC5424-compliant timestamp generation using zig-datetime.
33
+
34
+
-**shortstring.zig** - Fixed-capacity string type used for hostname (255 chars), app name (48 chars), and other bounded fields.
35
+
36
+
### Dependencies (in build.zig.zon)
37
+
38
+
-`zig-network` - TCP/UDP socket handling
39
+
-`zig-datetime` - Timestamp formatting
40
+
-`mailbox` - Used only in tests
41
+
42
+
### Entry Points
43
+
44
+
-**root.zig** - Public module exports (re-exports all submodules)
45
+
-**root_tests.zig** - Test entry point that imports all test declarations
0 commit comments