![]() |
LogIt++
Header-only, macro-first C++ logging library
|
LogIt++ requires CMake 3.18 or newer and TimeShield 2.0.x (minimum 2.0.0). The core library and most built-in backends use C++11. OTLP, the Prometheus HTTP server, and MDBX integrations require C++17.
Use add_subdirectory() when LogIt++ is part of the source tree:
The directory name is arbitrary. If dependencies are supplied as sibling targets, define them before adding LogIt++.
Then use the vendored CMake flow above. The bundled TimeShield submodule is a development fallback; package-manager builds may provide an installed time_shield::time_shield target instead.
Build and install the package from a clean checkout:
Consume it from another CMake project:
Pass -DCMAKE_PREFIX_PATH=/path/to/install when configuring the consumer.
The installation also provides a log-it-cpp pkg-config module. Set PKG_CONFIG_PATH to include the installation's share/pkgconfig and lib/pkgconfig directories, then use the module's flags when compiling:
The module declares the required time-shield dependency.
Enable only the features needed by the application. fmt, zlib, and zstd can be provided as installed CMake packages or by bundled submodules with LOGIT_USE_SUBMODULES=ON. LOGIT_WITH_OTLP=ON currently requires kurlyk for both OTLP logger variants because the option controls the shared OTLP build. MDBX requires mdbx-containers. Prometheus payload support has no extra dependency; the Prometheus HTTP server uses Simple-Web-Server and Asio.
See the Backend matrix for standards, dependencies, and platform restrictions. All CMake options are listed in the API reference.
Installed exports require optional dependencies to be available as installed or imported targets. Bundled optional dependencies are intended for source and build-tree development. LOGIT_WITH_PROMETHEUS_SERVER=ON is currently rejected by cmake --install because its HTTP dependency tree is not exported as part of the package.
The exported target is suitable for package-manager recipes that provide the required dependency targets before configuring LogIt++. For the repository's current vcpkg integration, follow the port and consumer checks in the CI workflow. Treat package-manager manifests as versioned integration metadata and verify them against the exact release tag being packaged.