liblognorm is a fast, samples-based log normalization library. It parses log messages (strings) into structured JSON objects based on a set of rules.
Important
READ THIS FIRST: The core engine logic is documented in doc/pdag_implementation_model.rst. This file contains critical "implementation deltas" that explain how the actual C code differs from the theoretical design (Master's thesis). Ignoring this file will lead to incorrect assumptions about the parser's behavior.
src/: Source code.doc/: Documentation (Sphinx reStructuredText).tests/: Test suite.
For a detailed breakdown of which files implement which concepts, see: doc/ai_architecture_map.md
- C99: The codebase is written in C99.
- Memory Management: Be careful with memory. The PDAG engine relies on specific ownership rules (see
pdag_implementation_model.rst). - Thread Safety: The library is designed to be thread-safe.
- Error Handling: Uses
goto donepattern for cleanup and error propagation.
- Adding a new parser: See
src/parser.c. Use thePARSER_Parse,PARSER_Construct, etc. macros. - Debugging: The library has a debug callback system (
ln_setDebugCB).
- Contextual Messages: Commit messages must explain why a change was made, not just what changed. Relate changes to the project strategy (e.g., "AI first strategy") where applicable.
- Attribution: All AI-assisted commits must include the following footer:
With the help of AI Agent: <agent-name> - Atomic Changes: Separate documentation updates from code changes when possible, or group them logically if they are tightly coupled.
- Relative Paths: Always use relative paths in documentation (e.g.,
doc/file.md, notfile:///...) to ensure portability across environments.