Commit Graph

654 Commits

Author SHA1 Message Date
Andrey Semashev
959a97c38b Avoid using deprecated Boost.Test headers. 2019-10-23 13:29:50 +03:00
Andrey Semashev
e80dce7fec Removed unused local typedefs. 2019-10-22 20:06:26 +03:00
Andrey Semashev
84b753da83 Removed unnecessary packages from CI jobs, added C++20 testing. 2019-10-22 01:09:48 +03:00
Andrey Semashev
710bd95d36 Moved extra tests to msvc-14.0 job to avoid job timeouts. 2019-10-14 23:13:22 +03:00
Andrey Semashev
81bc040eb5 Added more compilers to CI. 2019-10-14 00:18:00 +03:00
Andrey Semashev
77f6eba408 Added compiler barrier definition for clang-win to silence deprecated warnings. 2019-10-14 00:03:40 +03:00
Andrey Semashev
ca227bc2f3 Added a link to a more complete example for reading settings from file. 2019-06-25 20:21:27 +03:00
Andrey Semashev
1ce3c06ac6 Added a compilable example for initialization from a settings container.
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.
2019-06-25 20:10:50 +03:00
Andrey Semashev
a71dc018a8 Renamed settings_file_formatter_factory to settings_file_custom_factories.
Also, updated the example to register filter/formatter factories for the
custom severity level.
2019-06-25 19:25:45 +03:00
Andrey Semashev
08bd1fb809 Added support for trivial::severity_level to filter/formatter parsers.
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.
2019-06-25 18:54:55 +03:00
Andrey Semashev
61c96c519c Converted Bionic images back to Xenial as apt plugin doesn't work on Bionic. 2019-06-25 12:00:56 +03:00
Andrey Semashev
5bc02d4c4c Removed Precise images as they have outdated git. Switched to manual specification of Debian sources for clang. Switched to Bionic images where possible. 2019-06-24 19:00:16 +03:00
Andrey Semashev
9ce37914af Changed older clang jobs to Precise images because their apt sources are not registered for Trusty and Xenial in Travis CI. 2019-06-24 15:10:37 +03:00
Andrey Semashev
dad1c0518d Upgraded Travis CI images, added gcc-9 and clang-8. Workaround clang CI failures. 2019-06-24 13:32:00 +03:00
Andrey Semashev
e903d3aef7 Fixed compilation in C++03. 2019-06-24 04:34:44 +03:00
Andrey Semashev
e4f91a2431 Added support for arbitrary functions in filter and format named parameters.
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.
2019-06-24 04:04:09 +03:00
Andrey Semashev
ed5af03352 Corrected a typo. 2019-06-24 00:33:03 +03:00
Andrey Semashev
326d97a9d1 Added auto_newline stream manipulator and formatter.
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.
2019-06-24 00:27:16 +03:00
Andrey Semashev
2fbd7ae0f2 Added missing files. 2019-06-23 22:12:51 +03:00
Andrey Semashev
894acde57e Added support for controling trailing newline insertion in the text sinks.
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.
2019-06-23 21:02:51 +03:00
Andrey Semashev
4c7b3ede6e Simplified support for forwarding pointer types in formatting ostreams. 2019-05-26 17:47:24 +03:00
Andrey Semashev
d66ab73a5f Added forwarding of pointer type in Boost.Log streams.
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.
2019-05-25 21:38:04 +03:00
Andrey Semashev
3925052c30 Added explicit support for std::string_view in formatting_ostream.
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.
2019-05-25 21:27:49 +03:00
Andrey Semashev
2154cafa46 Optimized file status requesting while scanning for files. 2019-04-14 20:34:44 +03:00
Andrey Semashev
d7a87119e6 Fixed incorrect matching of digits in a file name against a placeholder.
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.
2019-04-14 20:14:58 +03:00
Andrey Semashev
4f5e669376 Use sort-circuiting mpl::or_ to avoid extra is_base_of instantiation. 2019-02-09 06:05:14 +03:00
Andrey Semashev
1f5ac28873 Updated Boost.Parameter tools for compatibility with its updated version.
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.
2019-02-08 22:23:54 +03:00
Andrey Semashev
c0d0fd33f3 Added a note about compiler TLS intrinsics not removing Boost.Thread dependency.
Some users mistakenly assumed that enabling compiler TLS intrinsics would
remove the need for Boost.Thread. This added note should remove that confusion.
2019-02-08 17:30:29 +03:00
Andrey Semashev
2dd530b8c3 Work around Boost.Parameter difference between develop and master for file_name.
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
2019-01-16 23:57:25 +03:00
Andrey Semashev
4110bfdd1e
Merge pull request #71 from Adnn/typo_fix
Fixes typo in the tutorial, "formatter" being used in place of "filter"
2019-01-15 17:19:50 +03:00
Adrien
e21753da4e Fixes typo in the tutorial, "formatter" being used in place of "filter" 2019-01-15 14:08:06 +01:00
Andrey Semashev
1138b47fce Removed linking with Boost.System.
Since Boost.System is now header-only, no need to link with the library.
2019-01-14 20:16:20 +03:00
Andrey Semashev
3e6fee4751 Counter compiler optimizations when checking for SSSE3 and AVX2.
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.
2019-01-08 00:56:24 +03:00
Andrey Semashev
effd8568a4 Disable Boost.Interprocess on Cygwin.
Boost.Interprocess doesn't compile on Cygwin:

https://github.com/boostorg/interprocess/issues/76

Also, disable affected tests and examples.
2019-01-06 19:51:48 +03:00
Andrey Semashev
fae655dbbd Don't use Boost.ASIO-related features in examples when Boost.ASIO is not available. 2019-01-06 19:51:37 +03:00
Andrey Semashev
136fd2bdfd CI compilation fixes for Cygwin and MinGW.
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.
2019-01-06 14:13:32 +03:00
Andrey Semashev
947d4361d4 Added a check for message compiler on Windows when building examples.
Disable event log examples when message compiler is not available. This
should hopefully fix MinGW failures in CI.
2019-01-06 02:17:46 +03:00
Andrey Semashev
61639024c9 Added _XOPEN_SOURCE=600 define for Cygwin, which is needed for pthread rwlocks. 2019-01-06 02:10:12 +03:00
Andrey Semashev
958ced0edd Work around MSVC name lookup bugs.
The compiler fails to find a symbol defined in an anonymous namespace, if
the name is qualified up to the namespace enclosing the anonymous namespace.
2019-01-06 02:00:44 +03:00
Andrey Semashev
691859e288 Trying to work around cmd quirks with variable expansion. 2019-01-05 21:57:42 +03:00
Andrey Semashev
5ed3f69c3b Disabled OS X CI jobs because of timeouts. 2019-01-05 21:50:29 +03:00
Andrey Semashev
e823f88467 Added support for a separate target file name pattern in text file sink.
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.
2019-01-05 21:15:33 +03:00
Andrey Semashev
6542145845 Try a newer Xcode image to workaround CI job hangs. 2019-01-05 15:34:14 +03:00
Andrey Semashev
46560ff9fb Removed unnecessary optimization in the check for an operator keyword.
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.
2019-01-05 15:04:26 +03:00
Andrey Semashev
413d0c3235 Corrected variable expansion in Appveyor CI config. 2019-01-05 14:47:40 +03:00
Andrey Semashev
4b0cc5a30f Reduced the amount of CI tests, enabled global visibility for UBSan.
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.
2019-01-05 04:53:16 +03:00
Andrey Semashev
9ddccb5e5c Added env variables that allow to disable building examples and standalone teader tests while testing. 2019-01-05 04:02:01 +03:00
Andrey Semashev
a14c56dc7f Corrected variable initialization in Appveyor CI. 2019-01-05 00:47:05 +03:00
Andrey Semashev
1b6db19c41 Updated CI configs to fix git checkouts.
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.
2019-01-04 19:14:29 +03:00
Andrey Semashev
551ad9e6c4 Added CI badges to the readme. 2019-01-03 23:39:25 +03:00