2
0
mirror of https://github.com/boostorg/log.git synced 2026-01-26 06:32:24 +00:00
Commit Graph

667 Commits

Author SHA1 Message Date
Andrey Semashev
009adf94c0 Added a release note about fixing compilation in MSYS2 Cygwin. 2020-02-23 15:24:15 +03:00
Andrey Semashev
4d9ce5cdba Check for feature test macros after including config.hpp.
This avoids possible inconsistency when the BOOST_LOG_WITHOUT_DEBUG_OUTPUT
and BOOST_LOG_WITHOUT_EVENT_LOG macros are defined in config.hpp but not
in command line.

Related to https://github.com/boostorg/log/issues/102.
2020-02-21 18:44:48 +03:00
Andrey Semashev
2f15b44dc1 Converted some uses of Boost.MPL to Boost.TypeTraits. 2020-02-17 18:41:29 +03:00
Andrey Semashev
e7bcb0ac4b Converted some uses of Boost.MPL to Boost.TypeTraits. 2020-02-17 18:28:39 +03:00
Andrey Semashev
34d9e64815 Reordered day and day kind initializers to match declaration order.
Silences compiler warnings.
2020-02-17 15:54:45 +03:00
Andrey Semashev
c721453aeb Ported named_scope_list and pool_allocator to allocator_traits.
This fixes compilation problems with C++20 std::allocator, which removed
deprecated typedefs and member functions.

Closes https://github.com/boostorg/log/pull/100.
2020-02-17 15:49:58 +03:00
Andrey Semashev
8a7cc8efd6 Move log file status check before renaming to the target file name.
If the log file has not been created (e.g. when there are no log records
written yet), rotate_file could throw as it attempted to rename the file
to the target file name before rotation. The check for file presence that
was intended to protect from this was made later on, before the file collector
is invoked. This commit moves the check before renaming.
2020-02-17 15:12:36 +03:00
Andrey Semashev
42b4463ad2 Fixed day kind representation in rotation_at_time_point.
Since day_kind is enum, it may be represented by a signed integer type.
Some compilers (e.g. MSVC) use sign extension when loading the day kind
field from the bit field, which corrupts the monthday value (which is 2)
and makes the rotation never happen. Fix this by using an unsigned type
to store the day kind and then cast the value to the enum.

Also, rearranged the bitfields for slightly better codegen.

Fixes https://github.com/boostorg/log/issues/98.
2020-02-05 17:30:55 +03:00
Andrey Semashev
10a63204b3 Added a workaround for openlog not saving ident string.
Some syslog implementations (e.g. glibc) do not save the ident string
in openlog and instead only save a pointer to the user-provided string.
This requires the caller to preserve the passed string for the whole
duration of logging.

Fixes https://github.com/boostorg/log/issues/97.
2020-01-22 21:37:56 +03:00
Andrey Semashev
b395be29c2 Removed spaces before ticket/issue/PR links in docs, updated copyright years. 2019-12-12 11:53:26 +03:00
Andrey Semashev
3f3d93c2c5 Merge pull request #93 from boostorg/pr/source-location
Use throw_exception overload taking source_location
2019-11-27 20:01:06 +03:00
Peter Dimov
ac17f4adcf Add source_location #include 2019-11-27 18:47:10 +02:00
Peter Dimov
a519226b38 Use throw_exception overload taking source_location 2019-11-26 17:28:12 +02:00
Andrey Semashev
959a97c38b Avoid using deprecated Boost.Test headers. boost-1.72.0.beta1 boost-1.72.0 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. boost-1.71.0.beta1 boost-1.71.0 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. boost-1.70.0.beta1 boost-1.70.0 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