From a4355cbc345a36cfd2c8638c7b283a47326be6f7 Mon Sep 17 00:00:00 2001 From: Dmitriy Khaustov aka xDimon Date: Fri, 20 Nov 2026 19:02:01 +0300 Subject: [PATCH] soralog: add version 0.3.1 Signed-off-by: Dmitriy Khaustov aka xDimon --- cmake/configs/default.cmake | 1 + cmake/projects/soralog/ci/matrix.json | 6 +++++ cmake/projects/soralog/hunter.cmake | 30 ++++++++++++++++++++++++ docs/packages/logging.rst | 1 + docs/packages/pkg/soralog.rst | 21 +++++++++++++++++ examples/soralog/CMakeLists.txt | 20 ++++++++++++++++ examples/soralog/boo.cpp | 33 +++++++++++++++++++++++++++ 7 files changed, 112 insertions(+) create mode 100644 cmake/projects/soralog/ci/matrix.json create mode 100644 cmake/projects/soralog/hunter.cmake create mode 100644 docs/packages/pkg/soralog.rst create mode 100644 examples/soralog/CMakeLists.txt create mode 100644 examples/soralog/boo.cpp diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 78392569a7..60ab27f107 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -530,6 +530,7 @@ hunter_default_version(sleef VERSION 3.3.1-p1) hunter_default_version(sm VERSION 1.2.3) hunter_default_version(smol-v VERSION 0.0.0-4b52c16-p0) hunter_default_version(soil VERSION 1.0.4) +hunter_default_version(soralog VERSION 0.3.1) hunter_default_version(sources_for_android_sdk_packer VERSION 1.0.0) hunter_default_version(sparsehash VERSION 2.0.2) diff --git a/cmake/projects/soralog/ci/matrix.json b/cmake/projects/soralog/ci/matrix.json new file mode 100644 index 0000000000..a0ddc7a2c9 --- /dev/null +++ b/cmake/projects/soralog/ci/matrix.json @@ -0,0 +1,6 @@ +[ +{ "example": "soralog", "toolchain": "clang-cxx20", "os": "ubuntu-24.04" }, +{ "example": "soralog", "toolchain": "gcc-13-cxx20", "os": "ubuntu-24.04" }, +{ "example": "soralog", "toolchain": "gcc-14-cxx20", "os": "ubuntu-24.04" }, +{ "example": "soralog", "toolchain": "osx-15-4-arch-universal2-cxx20", "os": "macos-15" } +] diff --git a/cmake/projects/soralog/hunter.cmake b/cmake/projects/soralog/hunter.cmake new file mode 100644 index 0000000000..8759974f56 --- /dev/null +++ b/cmake/projects/soralog/hunter.cmake @@ -0,0 +1,30 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + soralog + VERSION + "0.3.1" + URL + "https://github.com/xDimon/soralog/archive/refs/tags/v0.3.1.tar.gz" + SHA1 + eb974e1cf686f4b3172775606a4d51298cf10b24 +) + +hunter_cmake_args( + soralog + CMAKE_ARGS + BUILD_TESTS=OFF + BUILD_BENCHMARKS=OFF + EXAMPLES=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(soralog) +hunter_download(PACKAGE_NAME soralog) diff --git a/docs/packages/logging.rst b/docs/packages/logging.rst index 1d01e1612a..ac7a761bc7 100644 --- a/docs/packages/logging.rst +++ b/docs/packages/logging.rst @@ -4,4 +4,5 @@ Logging - :ref:`pkg.fmt` - Small, safe and fast formatting library - :ref:`pkg.glog` - C++ implementation of the Google logging module - :ref:`pkg.log4cplus` - simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. + - :ref:`pkg.soralog` - Fast and flexible C++ logger with low-overhead logging calls. - :ref:`pkg.spdlog` - Super fast C++ logging library. diff --git a/docs/packages/pkg/soralog.rst b/docs/packages/pkg/soralog.rst new file mode 100644 index 0000000000..d75133d741 --- /dev/null +++ b/docs/packages/pkg/soralog.rst @@ -0,0 +1,21 @@ +.. spelling:word-list:: + + soralog + +.. index:: logging ; soralog + +.. _pkg.soralog: + +soralog +======= + +- `Official `__ +- `Example `__ + +Fast and flexible C++ logger with low-overhead logging calls. +Requires C++20. + +.. literalinclude:: /../examples/soralog/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/examples/soralog/CMakeLists.txt b/examples/soralog/CMakeLists.txt new file mode 100644 index 0000000000..2d374f5225 --- /dev/null +++ b/examples/soralog/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2026, Dmitriy Khaustov +# All rights reserved. + +cmake_minimum_required(VERSION 3.10) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-soralog) + +# DOCUMENTATION_START { +hunter_add_package(soralog) +find_package(soralog CONFIG REQUIRED) + +add_executable(boo boo.cpp) +target_link_libraries(boo PUBLIC soralog::soralog soralog::yaml) +# DOCUMENTATION_END } + +set_target_properties(boo PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED YES) diff --git a/examples/soralog/boo.cpp b/examples/soralog/boo.cpp new file mode 100644 index 0000000000..c4c4c8dfe2 --- /dev/null +++ b/examples/soralog/boo.cpp @@ -0,0 +1,33 @@ +#include +#include +#include + +#include +#include +#include +#include + +int main() { + auto configurator = + std::make_shared(std::string(R"( +sinks: + - name: console + type: console +groups: + - name: main + sink: console + level: info + is_fallback: true +)")); + + soralog::LoggingSystem log_system(configurator); + auto result = log_system.configure(); + if (result.has_error) { + std::cerr << result.message << '\n'; + return EXIT_FAILURE; + } + + auto logger = log_system.getLogger("boo", "main"); + logger->info("Hello from soralog {}", 42); + return EXIT_SUCCESS; +}