|
Logger System 1.0.0
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
doc_id: "LOG-GUID-028" doc_title: "Logger System Build Guide" doc_version: "1.0.0" doc_date: "2026-04-18" doc_status: "Released" project: "logger_system"
SSOT: This document is the single source of truth for Logger System Build Guide.
Language: English
This guide provides complete build instructions for logger_system, including prerequisites, CMake options, optional features, and presets.
For a 5-minute smoke-test walkthrough, see Quick Start Guide. For getting started in code, see Getting Started Guide.
| Requirement | Minimum Version |
|---|---|
| CMake | 3.20 (3.28+ for C++20 modules) |
| C++ compiler | GCC 11+, Clang 14+, Apple Clang 14+, MSVC 2022+ |
| Git | any recent version |
Required dependency:
common_system - must be cloned alongside logger_system in the same parent directory.Optional dependencies (enabled per-feature below):
LOGGER_USE_ENCRYPTION=ON (default ON).thread_system - required when LOGGER_USE_THREAD_SYSTEM=ON (default OFF). Standalone std::jthread is used otherwise.opentelemetry-cpp 1.14+ - required when LOGGER_ENABLE_OTLP=ON (default OFF).BUILD_TESTS=ON (default ON).BUILD_BENCHMARKS=ON (default OFF).logger_system expects a peer-directory layout so CMake can locate optional sibling projects:
Clone them side by side:
Helper scripts are also provided:
The build produces:
liblogger_system.a (or logger_system.lib on MSVC)find_package(logger_system)build/bin/ when BUILD_TESTS=ONPresets wrap the common configurations documented in CMakePresets.json:
| Preset | Purpose |
|---|---|
default | Release, tests on, warnings-as-errors off |
debug | -DCMAKE_BUILD_TYPE=Debug |
release | -DCMAKE_BUILD_TYPE=Release |
asan | AddressSanitizer + UBSan |
tsan | ThreadSanitizer |
ubsan | UndefinedBehaviorSanitizer |
ci | Configuration used by the CI pipeline |
vcpkg | Uses the vcpkg toolchain file |
Example:
| Option | Default | Description |
|---|---|---|
BUILD_TESTS | ON | Build unit tests (Google Test) |
BUILD_BENCHMARKS | OFF | Build micro-benchmarks (Google Benchmark) |
LOGGER_USE_DI | ON | Dependency-injection-style writer composition |
LOGGER_USE_MONITORING | ON | Metrics and monitoring backend |
LOGGER_ENABLE_ASYNC | ON | Async writer implementations |
LOGGER_ENABLE_CRASH_HANDLER | ON | Crash-safe flush on signal/abort |
| Option | Default | Description |
|---|---|---|
LOGGER_ENABLE_STRUCTURED_LOGGING | OFF | JSON / key-value structured logs |
LOGGER_ENABLE_NETWORK_WRITER | OFF | TCP/UDP network writer |
LOGGER_ENABLE_FILE_ROTATION | ON | Rotating file writer |
LOGGER_USE_MODULES | OFF | Experimental C++20 modules (CMake 3.28+) |
LOGGER_USE_THREAD_SYSTEM | OFF | Use thread_system pool for async I/O |
LOGGER_USE_ENCRYPTION | ON | AES-256 encrypted writer (requires OpenSSL) |
LOGGER_ENABLE_OTLP | OFF | OpenTelemetry log export |
| Option | Default | Description |
|---|---|---|
LOGGER_DEFAULT_BUFFER_SIZE | 16384 | Default per-writer buffer size (bytes) |
LOGGER_DEFAULT_BATCH_SIZE | 200 | Default batch-writer flush size |
LOGGER_DEFAULT_QUEUE_SIZE | 20000 | Default async queue depth |
| Option | Default | Description |
|---|---|---|
LOGGER_ENABLE_SANITIZERS | OFF | Enable sanitizer instrumentation |
LOGGER_ENABLE_COVERAGE | OFF | Emit coverage flags (gcov / llvm-cov) |
LOGGER_WARNINGS_AS_ERRORS | OFF | Treat compiler warnings as errors |
See Performance Guide for how these values affect throughput and latency in practice.
Install OpenSSL via your package manager (apt install libssl-dev, brew install openssl@3, or vcpkg openssl). See Security Guide for key-management details.
thread_system IntegrationWhen enabled, async writers submit work to the thread_system thread pool rather than spawning std::jthreads. See Integration Guide.
Requires opentelemetry-cpp 1.14+ available via vcpkg or a system install. See OpenTelemetry Guide.
Requires CMake 3.28+, Clang 16+ or GCC 14+. The header-based interface remains the primary, supported API.
The install step writes headers, the static library, and CMake package files:
find_packageFetchContentPin to a release tag; do not track main.
| Platform | Status | Notes |
|---|---|---|
| Ubuntu 22.04+ (GCC 11+ / Clang 14+) | Supported | Primary CI target |
| macOS 13+ (Apple Clang 14+) | Supported | Primary CI target |
| Windows 11 (MSVC 2022) | Supported | Primary CI target |
| MinGW | Limited | Tests and benchmarks disabled |
| UWP / Xbox | Not supported | Use a different logging backend |