Skip to content
Merged
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
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,74 @@ jobs:
build-otlp/Testing/Temporary/LastTest.log
if-no-files-found: ignore

linux-package-consumers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Install package-consumer tools
run: sudo apt-get update && sudo apt-get install -y pkg-config
- name: Install TimeShield dependency
run: |
cmake -S external/time-shield-cpp -B build-timeshield \
-DTIME_SHIELD_CPP_BUILD_TESTS=OFF \
-DTIME_SHIELD_CPP_BUILD_EXAMPLES=OFF \
-DTIME_SHIELD_ENABLE_NTP_CLIENT=OFF \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install-timeshield"
cmake --build build-timeshield
cmake --install build-timeshield
- name: Build and install source package
run: |
cmake -S . -B build-package \
-DLOGIT_CPP_BUILD_TESTS=OFF \
-DLOGIT_WITH_SYSLOG=OFF \
-DLOGIT_WITH_WIN_EVENT_LOG=OFF \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install-logit" \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-timeshield"
cmake --build build-package
cmake --install build-package
- name: Configure pkg-config consumer
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/install-logit/share/pkgconfig:${{ github.workspace }}/install-timeshield/lib/pkgconfig
run: |
pkg-config --exists log-it-cpp
test "$(pkg-config --modversion log-it-cpp)" = "1.0.2"
pkg-config --print-requires log-it-cpp
pkg-config --print-requires log-it-cpp | grep -Fx 'time-shield >= 2.0.0'
pkg-config --print-requires log-it-cpp | grep -Fx 'time-shield < 2.1.0'
pkg-config --atleast-version=2.0.0 time-shield
cmake -S tests/pkgconfig_consumer -B build-pkgconfig
- name: Build and run pkg-config consumer
run: |
cmake --build build-pkgconfig
./build-pkgconfig/pkgconfig_consumer
- name: Create clean source archive
run: |
archive_root="$RUNNER_TEMP/logit-archive"
mkdir -p "$archive_root/source"
git archive --format=tar.gz --prefix=log-it-cpp/ HEAD > "$RUNNER_TEMP/log-it-cpp.tar.gz"
tar -xzf "$RUNNER_TEMP/log-it-cpp.tar.gz" -C "$archive_root/source"
- name: Build and install clean source archive
run: |
archive_source="$RUNNER_TEMP/logit-archive/source/log-it-cpp"
cmake -S "$archive_source" -B "$RUNNER_TEMP/logit-archive/build" \
-DLOGIT_CPP_BUILD_TESTS=OFF \
-DLOGIT_WITH_SYSLOG=OFF \
-DLOGIT_WITH_WIN_EVENT_LOG=OFF \
-DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/logit-archive/install" \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-timeshield"
cmake --build "$RUNNER_TEMP/logit-archive/build"
cmake --install "$RUNNER_TEMP/logit-archive/build"
- name: Build and run clean archive consumer
run: |
archive_source="$RUNNER_TEMP/logit-archive/source/log-it-cpp"
cmake -S "$archive_source/tests/install_consumer" -B "$RUNNER_TEMP/logit-archive/consumer" \
-DCMAKE_PREFIX_PATH="$RUNNER_TEMP/logit-archive/install;$GITHUB_WORKSPACE/install-timeshield"
cmake --build "$RUNNER_TEMP/logit-archive/consumer"
"$RUNNER_TEMP/logit-archive/consumer/install_consumer"

windows:
runs-on: windows-latest
strategy:
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
Expand All @@ -20,7 +22,7 @@ jobs:
with:
submodules: "true"
fetch-depth: 0
- name: Inject development version into mainpage.dox
- name: Inject documentation version into mainpage.dox
run: |
VERSION=$(sed -n 's/^project(log-it-cpp VERSION \([^ ]*\).*/\1/p' CMakeLists.txt | head -n 1)
if [ -z "$VERSION" ]; then
Expand All @@ -30,7 +32,16 @@ jobs:
VERSION="0.0.0-untagged"
fi
fi
DOC_VERSION="${VERSION}-dev"
if [ "${GITHUB_EVENT_NAME:-}" = "push" ] && [ "${GITHUB_REF_TYPE:-}" = "tag" ]; then
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$TAG_VERSION" != "$VERSION" ]; then
echo "Release tag v${TAG_VERSION} does not match project version ${VERSION}."
exit 1
fi
DOC_VERSION="$TAG_VERSION"
else
DOC_VERSION="${VERSION}-dev"
fi
echo "Using version: $DOC_VERSION"
echo "DOC_VERSION=$DOC_VERSION" >> "$GITHUB_ENV"
test -f docs/mainpage.dox || { echo "mainpage.dox not found!"; exit 1; }
Expand Down Expand Up @@ -95,7 +106,7 @@ jobs:
sleep 1
NODE_PATH="$PLAYWRIGHT_DIR/node_modules" node .github/scripts/docs-layout-smoke.cjs
- name: Publish generated content to GitHub Pages
if: github.event_name != 'pull_request'
if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

All notable changes to this project will be documented in this file.

## [Unreleased]

Target release: **v1.0.2**
## [v1.0.2] - 2026-09-15

### Added

Expand All @@ -29,6 +27,8 @@ Target release: **v1.0.2**
### Packaging / Build

- Refreshed bundled dependency revisions and canonical repository URLs.
- Updated the required TimeShield dependency to the 2.0.x line (minimum 2.0.0)
and migrated to its v2 header layout.
- Added fail-closed installation checks for unsupported bundled optional dependencies and source-tree-only Prometheus server headers.

### CI / Testing
Expand Down
14 changes: 14 additions & 0 deletions README-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,20 @@ cmake --install build --prefix ./install
поддерживаются только в source/build-tree; install намеренно завершается
ошибкой вместо создания неработающего package.

### Потребитель через pkg-config

При установке также создаётся модуль pkg-config `log-it-cpp`. Добавьте
каталоги pkg-config установленной библиотеки в `PKG_CONFIG_PATH` и используйте
флаги модуля при сборке consumer-проекта:

```bash
export PKG_CONFIG_PATH=/path/to/install/share/pkgconfig:/path/to/install/lib/pkgconfig
c++ -std=c++11 $(pkg-config --cflags log-it-cpp) \
app.cpp $(pkg-config --libs log-it-cpp) -o app
```

Модуль объявляет обязательную зависимость `time-shield`.

4. (Необязательно) Включите макросы fmt:

LogIt++ включает библиотеку *fmt* для форматирования с `{}`. Чтобы использовать макросы `LOGIT_FMT_*` и `LOGIT_SCOPE_FMT_*`, соберите библиотеку с опцией CMake `-DLOGIT_WITH_FMT=ON`.
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,20 @@ Pass `-DCMAKE_PREFIX_PATH=/path/to/install` when configuring the consumer.
currently supported for source/build-tree development only; the install step
rejects them rather than exporting a broken package.

### pkg-config consumer

The installation also provides a `log-it-cpp` pkg-config module. Set
`PKG_CONFIG_PATH` to the installation's pkg-config directories and use the
module's flags when compiling a consumer:

```bash
export PKG_CONFIG_PATH=/path/to/install/share/pkgconfig:/path/to/install/lib/pkgconfig
c++ -std=c++11 $(pkg-config --cflags log-it-cpp) \
app.cpp $(pkg-config --libs log-it-cpp) -o app
```

The module declares the required `time-shield` dependency.

4. (Optional) Enable fmt-style macros:

LogIt++ includes the *fmt* library for `{}`-based formatting. To use the `LOGIT_FMT_*` and `LOGIT_SCOPE_FMT_*` macros, build the library with the CMake option `-DLOGIT_WITH_FMT=ON`.
Expand Down
5 changes: 3 additions & 2 deletions cmake/log-it-cpp.pc.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: log-it-cpp
Description: LogIt C++ logging library
Version: @PROJECT_VERSION@
Cflags: -I${includedir}
Requires: time-shield >= 2.0.0, time-shield < 2.1.0
Cflags: -I${includedir}/logit_cpp
Libs:
4 changes: 2 additions & 2 deletions docs/comparison-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
подходит лучше компактного string-oriented логгера, общего event framework или
диагностической macro-утилиты?**

Сравнение проверено **10.09.2026** по следующим upstream-релизам:
Сравнение проверено **15.09.2026** по следующим upstream-релизам:

| Проект | Проверенная версия | Основная документация |
| --- | --- | --- |
| LogIt++ | `1.0.2-dev` (`main`) | [документация проекта](https://liminode.github.io/log-it-cpp/) |
| LogIt++ | `v1.0.2` | [документация проекта](https://liminode.github.io/log-it-cpp/) |
| spdlog | [`v1.17.0`](https://github.com/gabime/spdlog/releases/tag/v1.17.0) | [README](https://github.com/gabime/spdlog), [асинхронное логирование](https://github.com/gabime/spdlog/wiki/Asynchronous-logging) |
| Quill | [`v13.0.0`](https://github.com/odygrd/quill/releases/tag/v13.0.0) | [документация проекта](https://quillcpp.readthedocs.io/) |
| Boost.Log | [Boost `1.92.0`](https://www.boost.org/users/history/version_1_92_0.html) | [документация Boost.Log](https://www.boost.org/doc/libs/1_92_0/libs/log/doc/html/) |
Expand Down
6 changes: 3 additions & 3 deletions docs/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ answers a practical question: **when does LogIt++ fit better than a smaller
formatted-string logger, a general event framework, or a diagnostic macro
utility?**

The comparison was checked on **2026-09-10** against these upstream releases:
The comparison was checked on **2026-09-15** against these upstream releases:

| Project | Release checked | Primary documentation |
| --- | --- | --- |
| LogIt++ | `1.0.2-dev` (`main`) | [project documentation](https://liminode.github.io/log-it-cpp/) |
| LogIt++ | `v1.0.2` | [project documentation](https://liminode.github.io/log-it-cpp/) |
| spdlog | [`v1.17.0`](https://github.com/gabime/spdlog/releases/tag/v1.17.0) | [README](https://github.com/gabime/spdlog), [async logging](https://github.com/gabime/spdlog/wiki/Asynchronous-logging) |
| Quill | [`v13.0.0`](https://github.com/odygrd/quill/releases/tag/v13.0.0) | [project documentation](https://quillcpp.readthedocs.io/) |
| Boost.Log | [Boost `1.92.0`](https://www.boost.org/users/history/version_1_92_0.html) | [Boost.Log documentation](https://www.boost.org/doc/libs/1_92_0/libs/log/doc/html/) |
Expand Down Expand Up @@ -235,7 +235,7 @@ Choose LogIt++ with its trade-offs in mind:
backends.

The [upstream `google/glog` repository](https://github.com/google/glog) was
archived and made read-only as of the 2026-09-10 check; account for that
archived and made read-only as of the 2026-09-15 check; account for that
lifecycle status before adopting it as a new dependency.

**Consider IceCream-Cpp when:**
Expand Down
14 changes: 14 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ target_link_libraries(my_app PRIVATE log-it-cpp::log-it-cpp)

Pass `-DCMAKE_PREFIX_PATH=/path/to/install` when configuring the consumer.

## pkg-config 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:

```bash
export PKG_CONFIG_PATH=/path/to/install/share/pkgconfig:/path/to/install/lib/pkgconfig
c++ -std=c++11 $(pkg-config --cflags log-it-cpp) \
app.cpp $(pkg-config --libs log-it-cpp) -o app
```

The module declares the required `time-shield` dependency.

## Optional dependencies and features

Enable only the features needed by the application. `fmt`, zlib, and zstd can
Expand Down
9 changes: 9 additions & 0 deletions tests/pkgconfig_consumer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.18)
project(pkgconfig_consumer LANGUAGES CXX)

find_package(PkgConfig REQUIRED)
pkg_check_modules(LOGIT REQUIRED IMPORTED_TARGET log-it-cpp)

add_executable(pkgconfig_consumer main.cpp)
target_compile_features(pkgconfig_consumer PRIVATE cxx_std_11)
target_link_libraries(pkgconfig_consumer PRIVATE PkgConfig::LOGIT)
8 changes: 8 additions & 0 deletions tests/pkgconfig_consumer/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <logit.hpp>

int main() {
LOGIT_ADD_CONSOLE_DEFAULT();
LOGIT_INFO("pkg-config consumer works");
LOGIT_WAIT();
return 0;
}
6 changes: 5 additions & 1 deletion vcpkg-overlay/ports/log-it-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME log-it-cpp CONFIG_PATH lib/cmake/log-it-cpp)

vcpkg_fixup_pkgconfig()
# vcpkg's isolated fixup check does not include the dependency port's
# pkg-config directory, even though time-shield is declared in Requires.
# The relocatable metadata is still rewritten; the dependency is validated by
# the dedicated Linux pkg-config consumer job.
vcpkg_fixup_pkgconfig(SKIP_CHECK)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

Expand Down
Loading