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

909 Commits

Author SHA1 Message Date
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
Andrey Semashev
e9e8579607 Added CMake MinGW-w64 job to GHA. 2024-12-15 18:27:15 +03:00
Andrey Semashev
ddb9868bfb Disable std::codecvt<char16_t> and std::codecvt<char32_t> for C++20 and later.
These specializations were deprecated in C++20, and libc++-19 now generates
deprecation warnings when using std::codecvt<char16_t> and
std::codecvt<char32_t> in C++20 and later modes.
2024-12-07 17:32:58 +03:00
Andrey Semashev
403fff4062 Removed macos-12 job from GHA CI.
The image is deprecated.
2024-12-07 17:05:29 +03:00
Andrey Semashev
a741a34df2 Added new gcc and clang versions to GHA CI. 2024-12-07 17:05:22 +03:00
Andrey Semashev
1be88666c5 Replaced address::from_string with make_address.
address::from_string functions in Boost.ASIO were deprecated and removed.
Use make_address free functions as a replacement.

Fixes https://github.com/boostorg/log/issues/239.
boost-1.87.0.beta1 boost-1.87.0
2024-11-05 18:16:18 +03:00
Andrey Semashev
29e5fc6504 Fixed grammar in the docs. 2024-10-29 18:50:49 +03:00
Andrey Semashev
440b160c91 Replaced leftover BOOST_STATIC_ASSERT_MSGs with static_assert. 2024-10-11 00:07:47 +03:00
Andrey Semashev
c126392841 Switched from atomic_count to Boost.Atomic for reference counting.
This avoids including a deprecated header from Boost.SmartPtr implementation
details.

Closes https://github.com/boostorg/log/pull/236.
2024-09-29 19:30:32 +03:00
Andrey Semashev
028247d2e6 Updated dependencies in CMakeLists.txt.
Removed unused dependences, made Boost.WinAPI Windows-specific.
2024-08-19 02:39:07 +03:00
Andrey Semashev
26c93dc061 Replaced Boost.Thread synchronization primitives with std equivalents.
This replaces boost::thread and most mutexes and condition variables with
std equivalents. It also adds support for std lock types to the strictest_lock
type trait.

This significantly, although not completely, reduces the dependency on
Boost.Thread.

Refs https://github.com/boostorg/log/issues/232.
2024-08-16 20:01:18 +03:00
Andrey Semashev
9a906e2f54 Expanded comment re. windres.exe workaround. boost-1.86.0.beta1 boost-1.86.0 2024-06-13 21:25:00 +03:00
Andrey Semashev
8c8124c730 Added a changelog entry for the windres.exe workaround. 2024-06-13 21:15:15 +03:00
Andrey Semashev
0843c5877e Added a comment to reference windres.exe issue. 2024-06-13 21:09:27 +03:00
Andrey Semashev
d3670d29a1 Merge pull request #231 from hiiiik/develop
Fixed compilation error on MinGW-w64.
2024-06-13 21:06:41 +03:00
ik
32d0ebf3fe Fixed compilation error on MinGW-w64.
The default behavior of windres.exe to read the output of the
preprocessor is using popen. However, the popen implementation may be
buggy on some non-English hosts, which would cause a compilation error
like this:

windres.exe: can't open file `page:': Invalid argument

Fix by adding '--use-temp-file' option and windres.exe will use a
temporary file to read instead of using opoen.

Signed-off-by: ik <hello_ik@outlook.com>
2024-06-11 22:20:02 +08:00
Andrey Semashev
901600febf Replaced macos-11 GHA image with 12, 13 and 14 since 11 is being removed. 2024-05-21 01:20:30 +03:00