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.
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.
* 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.
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.
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.
Boost.Log supports compilers that do not qualify as C++11 compilers
for Boost.Regex, even if they are compiling in C++11 mode. In that
case, we still need to link with Boost.Regex v4 prebuilt library.
For more recent compilers, Boost.Regex v5 is used, and that is
a header-only library. This commit removes linking with Boost.Regex
when this is detected at configure time.
Note that only Boost.Build is updated. CMake doesn't need to be
updated since even header-only libraries need to be listed as
dependencies.
Closes https://github.com/boostorg/log/pull/219.
The manipulator allows to inject user's function into a stream output
expression. The manipulator will pass a reference to the stream to
the user's function as the first parameter, optionally followed by
additional arguments passed to the manipulator construction.
This is needed because Boost.Regex includes windows.h internally,
which causes it to define a different target Windows version than
that is used by Boost.Log, which results in linking errors.
https://github.com/boostorg/regex/issues/154
Although attributes are normally only shallow-copied, it is useful to allow
the channel attribute to be deep copied when the parent logger is copied. This
would eliminate the unexpected effect of modifying the channel in the copy, as
it would otherwise affect the original logger. This commit makes copy
constructor and assignment of the channel loggers deep-copy the channel value.
The problem was reported in:
https://stackoverflow.com/questions/66120806/deep-copy-of-boost-logger.
Note that any other attributes that might have been added to the logger are
still shallow copied.
The _SCL_SECURE_NO_WARNINGS, _SCL_SECURE_NO_DEPRECATE,
_CRT_SECURE_NO_WARNINGS and _CRT_SECURE_NO_DEPRECATE macros need to be
defined for every compiler that uses MSVC C/C++ runtime, so instead of
duplicating these definitions in multiple places, define them for
Windows platform regardless of the compiler. In particular, they are
now defined for clang-cl.
The manipulator and formatter can be used to ensure a certain piece of output
ends with a newline without introducing duplicate newline characters if the
previous output ended with a newline already.
When a user defines an output operator for std::basic_ostream and
a pointer to a user-defined type, that operator use to be ignored
because of the implicit cast to const void* that happened when
operator<< for formatting_ostream or record_ostream was called.
We now forward the pointer type to the operator<< for std::ostream,
so it is either cast then or user's operator<< is picked.
Fixes https://github.com/boostorg/log/issues/84.
Explicit output operators allow to enable character code conversion, if
one is needed, on string view output. This is in line with the existing
support for other string types.
Some tests pull in pthread rwlock and therefore need _XOPEN_SOURCE=600
or higher to compile. Added platform defines to tests and examples
for good measure.
For MinGW worked around Boost.Build error when BOOST_LOG_WITHOUT_EVENT_LOG
is defined.
The implementation in Boost.Core was based in unhandled_exception_count
in Boost.Log, therefore we remove our loca implementation in favor
of the common one.
included into the size limit.
The max_size method on the stream buffer will now attempt to truncate
the attached string on the character boundary.
Fixed character boundary detection for multibyte encodings.
Clean up the overflow flag and the max size limit after the formatter
has completed.
Added a test for the max_size decorator.
Cleaned up some includes and reduced the dependency on Boost.Thread.