Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 6 additions & 0 deletions cmake/projects/soralog/ci/matrix.json
Original file line number Diff line number Diff line change
@@ -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" }
]
30 changes: 30 additions & 0 deletions cmake/projects/soralog/hunter.cmake
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions docs/packages/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
21 changes: 21 additions & 0 deletions docs/packages/pkg/soralog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling:word-list::

soralog

.. index:: logging ; soralog

.. _pkg.soralog:

soralog
=======

- `Official <https://github.com/xDimon/soralog>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/soralog/CMakeLists.txt>`__

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 }
20 changes: 20 additions & 0 deletions examples/soralog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
33 changes: 33 additions & 0 deletions examples/soralog/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <soralog/impl/configurator_from_yaml.hpp>
#include <soralog/logging_system.hpp>
#include <soralog/logger.hpp>

#include <cstdlib>
#include <iostream>
#include <memory>
#include <string>

int main() {
auto configurator =
std::make_shared<soralog::ConfiguratorFromYAML>(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;
}
Loading