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

894 Commits

Author SHA1 Message Date
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
Andrey Semashev
38bf38e835 Use _xgetbv intrinsic on Windows for AVX2 detection.
The intrinsic is supported since VS2010 SP1, which is below our minimum
supported MSVC version. The intrinsic is the proper way to detect
support for AVX register state by the OS instead of the undocumented
GetEnabledExtendedFeatures WinAPI function.
2024-04-13 17:50:11 +03:00
Andrey Semashev
2d932ddcb5 Updated links to Boost libraries docs. boost-1.85.0 2024-04-07 23:58:00 +03:00
Andrey Semashev
e5e4e9554f Changed http to https in Boost URLs. 2024-04-07 20:15:43 +03:00
Andrey Semashev
ea643a6f1d Updated URL to Boost.System docs. 2024-04-07 20:13:57 +03:00
Andrey Semashev
e79cfd841f Explicitly specify TOC depth. boost-1.85.0.beta1 2024-03-02 18:38:56 +03:00
Andrey Semashev
5f84f9130c Expanded leading explanation for attributes.
Related to https://github.com/boostorg/log/issues/226.
2024-03-02 18:10:25 +03:00
Andrey Semashev
433aa87b8c Minor wording improvement. 2024-03-02 16:01:59 +03:00
Andrey Semashev
d9d1f59375 Moved How to read and Definitions to the front page of the docs.
This makes these sections better exposed to an impatient reader, as
that information is useful for better understanding of the rest of
the docs.

Also extracted installation sections to a separate file.

Related to https://github.com/boostorg/log/issues/226.
2024-03-02 15:41:02 +03:00
Andrey Semashev
0b09e69c45 Removed MinGW32 AppVeyor job.
This compiler is no longer supported by Boost.System.

https://github.com/boostorg/system/issues/116
2024-02-07 00:01:09 +03:00
Andrey Semashev
b9c4024c0d Replaced actions/checkout usage with manual download commands.
This fixes the deprecation warnings for actions/checkout@v3. actions/checkout@v4
is not functional because of the upstream bug:

https://github.com/actions/checkout/issues/1590
2024-02-06 00:54:48 +03:00
Andrey Semashev
8d1605728e Reduced CI job timeouts. 2024-02-06 00:50:36 +03:00
Andrey Semashev
d30bc4e500 Added gcc-13 CI job. 2024-02-06 00:49:12 +03:00
Andrey Semashev
6bb218f22e Added clang-17 GHA jobs. 2024-01-14 22:36:44 +03:00
Andrey Semashev
500d05cb9e Added Windows jobs to GitHub Actions CI. 2024-01-14 22:27:18 +03:00
Andrey Semashev
609b700a5b Removed unneeded Boost.Filesystem include. 2024-01-14 22:14:53 +03:00