2
0
mirror of https://github.com/boostorg/log.git synced 2026-01-19 04:22:09 +00:00

925 Commits

Author SHA1 Message Date
Andrey Semashev
f0d196ee03 Avoid signed/unsigned mismatch warning when time_t is 32-bit (e.g. on Cygwin32). 2025-12-30 11:24:07 +03:00
Andrey Semashev
f461ca6fe6 Removed redundant checks for __CYGWIN__ that are excluded by BOOST_WINDOWS. 2025-12-26 17:35:03 +03:00
Andrey Semashev
3efa06b889 Removed disablement of IPC utilities on Cygwin in tests and examples. 2025-12-26 17:22:43 +03:00
Andrey Semashev
2fc825acfe Use new Boost.Filesystem platform API macros. 2025-12-26 16:00:53 +03:00
Andrey Semashev
d70b528bc5 Fixed typos in comments. 2025-12-17 04:16:11 +03:00
Andrey Semashev
3ea24c81f2 Enable building IPC components on Cygwin.
Reportedly, Boost.Interprocess has been fixed on Cygwin, so we can enable
building IPC components by default on this target.

Refs https://github.com/boostorg/interprocess/issues/242.
2025-12-14 03:09:14 +03:00
Andrey Semashev
fa2af18239 Replaced macos-13 with macos-15 in GitHub Actions.
The macos-13 image is retired, macos-15 is now available.
2025-12-13 20:43:36 +03:00
Andrey Semashev
014f344715 Removed C++17 mode job for clang-5.0 from GitHub Actions.
Boost.Mp11 no longer supports C++17 mode with clang-5.0 and causes
compile errors in Boost.MultiIndex and Boost.PropertyTree.

Refs https://github.com/boostorg/mp11/issues/111.
boost-1.90.0
2025-11-06 05:03:50 +03:00
Andrey Semashev
ce82e7f8f2 Removed clang 3.5 and 3.6 from GitHub Actions CI.
Boost.SmartPtr now requires a fully functional <atomic>, and these compilers
fail to compile it.
2025-11-06 04:45:55 +03:00
Andrey Semashev
826df254f0 Fixed a long loop on file rotation if filename pattern did not include counter.
If the log file is configured for appending and rotation_size limit is set,
text_file_backend::consume would repeatedly attempt to reopen the log file with
a new counter value in attempt to find a file with a size below the
rotation_size limit. This logic breaks if the file name pattern does not
include a file counter placeholder, as it means the backend would repeatedly
attempt to open the same file, whose size would exceed the limit. The loop
would terminate after 2^32 iterations, but that may take a while.

Avoid this fallback if we know the file counter placeholder is missing
in the file name pattern.

Also, make fil size checks more robust against integer overflows.

Fixes https://github.com/boostorg/log/issues/252.
2025-11-06 00:59:55 +03:00
Andrey Semashev
dfe99bee62 Added a sanity check for value_ref over an empty type list. boost-1.90.0.beta1 2025-10-25 01:48:10 +03:00
Andrey Semashev
b1fd6a2423 Fix incorrect constant used for PP iteration limit in value_ref visitation.
This fixes generation of apply_visitor_dispatch template specializations
that are supposed to terminate the lookup recursion and optimize for
a small number of (last) lookup steps. The bug was reported on the ML:

https://lists.boost.org/archives/list/boost@lists.boost.org/message/PN6TVYAFH2ICX5ENT76ARTQ7V372G5F2/
2025-10-25 01:45:59 +03:00
Andrey Semashev
3ab24d1e4f Merge pull request #251 from Flamefire/fix-cmake-version
Fix required CMake version
2025-10-01 17:41:36 +03:00
Alexander Grund
4f081ca212 Fix required CMake version 2025-10-01 10:18:16 +02:00
Andrey Semashev
a46993b0b8 Merge pull request #250 from Flamefire/test-link-update
Update Link to regression test matrix in README
2025-08-25 19:06:16 +03:00
Alexander Grund
f16f8026e8 Update Link to regression test matrix in README 2025-08-25 17:26:30 +02:00
Andrey Semashev
ad2eb6c4e5 Added docs, examples and test for wrap_formatter. boost-1.89.0 2025-07-11 10:28:46 +03:00
Andrey Semashev
86c8cdcced Added a wrap_filter utility.
The wrap_filter helper can be used to inject user-defined filter
functions into Boost.Log filtering expressions.

Added implementation, tests, docs and examples.

Refs https://github.com/boostorg/log/issues/195.
2025-07-11 03:23:01 +03:00
Andrey Semashev
173b993ac4 Merge pull request #249 from chriskohlhoff/boost_asio_core
Use new minimal boost_asio_core dependency.
2025-07-09 20:03:37 +03:00
Christopher Kohlhoff
ef6aec2abb Use new minimal boost_asio_core dependency.
Re-enable Boost.Asio in 32-bit MinGW-w64 job in AppVeyor.
2025-07-08 22:30:42 +10:00
Andrey Semashev
805f0cf971 Change searched-lib to lib in the Jamfile.
Apparently, searched-lib was not supposed to be used in libraries,
and the simple lib target is the preferred way to declare external
libraries.

https://github.com/bfgroup/b2/issues/431#issuecomment-2985057673
2025-06-19 02:42:42 +03:00
Andrey Semashev
6db171e348 Specify relative path to log-platform-config in config checks.
This allows to use the config checks from locations other than the
library project.
2025-06-19 02:29:02 +03:00
Andrey Semashev
f01996cfd3 Removed dependency on Boost.Random.
Boost.Random imposes excessive compiler requirements that prevents
Boost.Log from being built and tested with 32-bit gcc 8 on MinGW-w64.
We only need a fast RNG to quickly shuffle sinks in case of thread
contention in the core.

Use a local implementation of xorshift64 for such an RNG, which should
be even faster than taus88 and have sufficiently good quality. Also,
use std::random_device to initialize the PRNG. Keep the clock/thread_id
based initialization as a backup, in case if std::random_device fails.

Refs https://github.com/boostorg/random/issues/131.
2025-06-14 20:19:55 +03:00
Andrey Semashev
71635b6fba Disable Boost.ASIO in 32-bit MinGW-w64 job in AppVeyor.
Boost.ASIO depends on Boost.Context, which requires cxx11_thread_local
that is not supported on this target. This prevents Boost.Log from
being built and tested.

Refs https://github.com/chriskohlhoff/asio/issues/1637.
2025-06-13 17:18:18 +03:00
Andrey Semashev
ecc4466bc0 Added BOOST_LOG_WITHOUT_ASIO config option.
This lets users to disable Boost.ASIO-related functionality and remove
the dependency on Boost.ASIO. This may be useful on platforms where
Boost.ASIO or its dependencies don't work or disabled.

Refs https://github.com/chriskohlhoff/asio/issues/1637.
2025-06-13 17:17:31 +03:00
Andrey Semashev
a30d931348 Added new gcc and clang jobs to GitHub Actions. 2025-06-13 15:29:38 +03:00
Andrey Semashev
6b2d476f02 Removed extra tests from all AppVeyor jobs but one.
This reduces the CI run time on AppVeyor, which is already too slow.
Extra tests on other configurations are run on GitHub Actions.
2025-06-13 13:45:43 +03:00
Andrey Semashev
c6a268af54 Enabled extra tests on MinGW-w64 in GitHub Actions.
Also moved the extra tests to a separate job to avoid timeouts.
2025-06-13 13:41:06 +03:00
Andrey Semashev
40eaf1923f Use Azure mirrors of Ubuntu .deb repositories in containers.
This reduces the likelihood of spurious CI failures caused by DDoS filters
being triggered by massive numbers of concurrent CI jobs.
2025-06-13 02:17:28 +03:00
Andrey Semashev
d6528b6e0c Removed windows-2019 GitHub Actions jobs.
The windows-2019 image is deprecated and will soon be removed. This
means MSVC versions prior to 14.3 are no longer tested in GitHub
Actions, only on AppVeyor CI.

In order to avoid CI job timeouts, split MSVC 14.3 into two jobs,
one for C++14 and extra header tests and another one for other
C++ versions.
2025-06-12 02:08:46 +03:00
Andrey Semashev
d6aa912c7d Removed detail/pause.hpp.
This header was no longer used as all uses have been ported to the
better thread_pause equivalent in Boost.Atomic.
2025-06-12 00:35:09 +03:00
Andrey Semashev
fdcd3a233c Reimplemented adaptive_mutex using Boost.Atomic.
adaptive_mutex now uses Boost.Atomic on all platforms that support
lock-free atomics native waiting/notifying operations for unsigned int
and pthreads on the other platforms. Windows always uses Boost.Atomic.

The new implementation blocks the thread after a number of attempts
to acquire the lock with spinning backoff. This should reduce CPU load
if for some reason the thread that owns the lock is holding it for a
long time (which typically should not happen, since adaptive_mutex is
currently only used in threadsafe_queue, which doesn't hold the lock
for too long, unless the holder gets preempted).

The change may be significant on POSIX systems, which previously always
used pthreads, and performance characteristics of pthread_mutex_t could
have been different from our Boost.Atomic-based implementation.
2025-06-12 00:22:37 +03:00
Andrey Semashev
48a33d9eb0 Use thread_pause from Boost.Atomic in ipc_reliable_message_queue. 2025-06-11 23:18:05 +03:00
Andrey Semashev
b2e49a9113 Replaced MinGW-w64 gcc 6 jobs with gcc 8.
gcc 6 is no longer supported since it doesn't provide synchronization
library that is needed by Boost.Atomic.
2025-05-31 16:28:00 +03:00
Andrey Semashev
1cb564b688 Added dependency on Boost.Regex in regex-header-only test.
This may be needed in modular builds.
2025-05-31 16:23:39 +03:00
Andrey Semashev
9ee2e2953c Check for native atomic int32 in tests.
If native atomic int32 is not supported, Boost.Log disables IPC utilities,
so make a similar check in tests Jamfile to disable the corresponding tests.
2025-05-31 16:18:13 +03:00
Andrey Semashev
1c956799d5 Made configure check for native atomic int32 more lightweight.
Only include capabilities.hpp to test whether native atomic int32
is supported.

Also added a dependency on Boost.Atomic, which may be needed in
modular builds.
2025-05-31 16:05:06 +03:00
Andrey Semashev
4bd90c7d6c Allow multiple defines to be specified in has-config-flag. 2025-05-30 15:44:23 +03:00
Andrey Semashev
15bfb08b0a Relax property check in has-config-flag.
We are only interested in whether a config flag is defined, the value
of the define is irrelevant. So instead of checking for a value of 1,
detect the flag with any value, if present.
2025-05-30 15:10:23 +03:00
René Ferdinand Rivera Morell
2530a4e03a Add support for modular build structure. (#233)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Clean up build dependencies.

* Remove external build references and avoid custom project loading.

* Use relative paths to declare config sub-projects.

* Add missing NO_LIB usage requirements.

* Add missing library ref.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Update dependencies.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Remove custom symbolic project names for config subprojects. And use project root relative targets.

* Move private deps to the build project.

* Put back default boost locale link as locale build is now fixed.

* Set default address-model and architecture to avoid extra/custom detection logic. Put back missing check and config rules.

* Adjust doc build to avoid boost-root references.

* Fix ref to predef.jam location.

* Have B2 build use same deps as CML for per-target private/public.

* Add log dep to log_setup, as it's needed on some platforms.

* Add boost_log_with_support target to mirror CML.

* Fix platform specific winapi dependency spec.
2025-05-26 00:48:16 +03:00
Andrey Semashev
ad61f2c13e Disabled MSVC warnings about implicitly defined ctor/assignment being deleted.
Closes https://github.com/boostorg/log/issues/247.
Closes https://github.com/boostorg/log/pull/248.
2025-05-14 17:36:20 +03:00
Andrey Semashev
7fc4a55d33 Removed usage of obsolete ubuntu-20.04 GHA image. 2025-04-19 18:20:49 +03:00
Andrey Semashev
fea445eaa9 Unconditionally use std::unique_ptr. 2025-04-19 18:15:02 +03:00
Andrey Semashev
75f2e8eb6d Use locale-independent formatting of the file counter in text_file_backend.
This fixes failures in the subsequent parsing of the file names in
file_collector::scan_for_files.

Closes https://github.com/boostorg/log/pull/246.
2025-04-19 18:07:22 +03:00
Andrey Semashev
521d30d2cf Cast character types when calling character classification functions. 2025-04-19 16:42:38 +03:00
Andrey Semashev
724e888b5a Only reuse the old counter if the file name pattern has a counter placeholder.
If text_file_backend is set up to append to a previously written file, and
the actively written file name pattern does not include a file counter
placeholder but the target file name pattern does, we used to skip incrementing
the file counter in an attempt to generate the same file name as was last used,
so that we open the last used file for appending. While it did result in
reusing the last written file, since the counter was not incremented, the next
rotation would generate the last used target file name, which would result in
overwriting the last rotated file instead of adding a new file to the storage.

To mitigate this, only skip incrementing the counter if the file name pattern
for the actively written file actually has a counter placeholder. This way,
the counter will get incremented in the case described above, and on rotation
a new target file name will be generated.

Fixes https://github.com/boostorg/log/issues/245.
boost-1.88.0
2025-03-18 01:46:11 +03:00
Andrey Semashev
6366d73335 Updated references to Boost.Interprocess issue with Cygwin. boost-1.88.0.beta1 2024-12-17 04:29:24 +03:00
Andrey Semashev
8d4492d90f Added a Cygwin job to GitHub Actions.
Only test C++14 and up and only debug builds since building and running tests
on Cygwin is extra slow.
2024-12-17 00:15:39 +03:00
Andrey Semashev
3dacd004ae Added linking log_setup with ws2_32 on MinGW-w64.
The dependency is introduced by Boost.ASIO, when it is enabled.

Closes https://github.com/boostorg/log/pull/241.
2024-12-15 19:02:49 +03:00
Andrey Semashev
aa0acf366d Create output directory for Message Compiler tool.
Presumably, windmc.exe from MinGW-w64 fails if the output directory
doesn't exist. So create it prior to running the tool.

Additionally, removed explicit markup of the tool outputs as generated
sources. This should be done automatically by add_custom_command.

Also, added the max CMake version to silence its warnings.
2024-12-15 18:40:41 +03:00