The new example demostrates working with the settings container directly
and provides a more complete view on the library initialization.
Closes https://github.com/boostorg/log/issues/87.
The default filter/formatter factories will now be able to extract severity
level values of type boost::log::trivial::severity_level. For filters, this
is only supported for attributes with the "Severity" name.
This allows to specify directly custom function objects, including C++11
lambda functions, in the filter and format named parameters in the sink
initialization calls.
Closes https://github.com/boostorg/log/issues/63.
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.
Text ostream, file and multifile sink backends now support controlling trailing
newline insertion after every log records. The supported modes are described by
the auto_newline_mode enum. The behavior can be controlled via the same-named
named parameter, a set_auto_newline_mode call or the AutoNewline parameter
in the settings.
The default behavior has changed from the previous releases. From now on the
trailing newline will only be added if there isn't one in the formatted log
message 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.
If a file name pattern ended with a placeholder, e.g. a file counter, file names
fitting that pattern would not be matched by scan_for_files, leaving such files
unmanaged.
Fixes https://github.com/boostorg/log/issues/78.
Boost.Parameter added new named parameter wrappers for compatibility with
Boost.MP11. The SFINAE helper used to detect named parameters in Boost.Log
has been updated to work with these new types and potentially any new
types that may come in the future.
Some users mistakenly assumed that enabling compiler TLS intrinsics would
remove the need for Boost.Thread. This added note should remove that confusion.
This commit reworks file_name parameter handling for the file sink setup helper.
Boost.Parameter was modified recently in develop, which made it incompatible
with the previous implementation of the file_name helpers. At the same time,
it has not been merged to master, and the master version is not compatible
with the new implementation.
To resolve this, avoid mentioning the actual type of the tagged argument
constructed from the assignment to the named parameter keyword. This type refers
to Boost.Parameter implementation details namespace, so as a bonus we reduce
the dependency on Boost.Parameter implementation details.
See: https://github.com/boostorg/parameter/issues/65
The compiler is able to optimize away most of the instructions that we test,
which results in checking only the compiler support for intrinsics, and not
the assembler capability to translate SSSE3 and AVX2 instructions from assembler
into the actual binary code. This commit forces the compiler to actually emit
instructions in the assembler, which then tests binutils capability to translate
those into binary code.
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.
This allows to have different file names when actively writing the log file
and when rotating. In particular, this solves the problem with appending
to the previous file, when the log files are also collected and are supposed
to have distincs names.
Modern compilers are able to optimize memcmp to a single cmp instruction
with a constant, which was the intention of the optimization. This should
fix UBSan errors.
Disabled separate 32-bit and GNU C++ builds for CI. For most jobs also
disabled building examples and self-contained header tests. For UBSan
jobs enabled global visibility in attempt to work around the bogus
errors about calling virtual functions through a pointer to a base class.
Boost.Log tests include compilation of all examples, so depinst needs
to pull dependencies of examples, in addition to the library itself and
its tests.
Also, added --jobs argument to the `git submodule update` executed by
depinst and increased the number of jobs to 8.