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

925 Commits

Author SHA1 Message Date
Edward Diener
2cfc379f8f [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-20 13:25:18 -05:00
Andrey Semashev
1c4de7d8c6 In the add_file_log docs, describe the special meaning of the target param.
Added a note that the target named parameter enables file collector and limits
associated with the target directory.
2020-12-07 02:41:26 +03:00
Andrey Semashev
d667377004 Fixed infinite join wait in asynchronous_sink::stop().
Commit e0cb0b7d67 introduced a bug causing
stop() to infinitely wait for the feeding thread to join because it
is blocked waiting for new records or notifications. Notify the thread
when stop() is called.

Fixes https://github.com/boostorg/log/issues/135.
boost-1.75.0
2020-12-01 15:34:23 +03:00
Andrey Semashev
a36417bcf3 Minor cleanup. boost-1.75.0.beta1 2020-09-28 12:21:28 +03:00
Andrey Semashev
e0cb0b7d67 Resolved a possible conflict between flush and run in asynchronous_sink.
If run is called in a user's thread, and flush is called before the user's
thread enters run, flush would mark the sink frontend as being used by
another record feeding thread and run would exit with an exception.

To mitigate this, we now only throw exception when either run or
feed_records is being called in multiple threads, but not flush. When flush
is in progress, run and feed_records will block until the flush is
complete. This ensures that the sink backend is only used from one thread
at a time.

Additionally, stop now explicitly doesn't wait for the ongoing record
feeding operation to complete. It is generally not possible to ensure that
the record feeding thread has left (or won't enter) the feeding operation
after stop returns. When the internal feeding thread is used we ensure
that the thread is done by joining it. When user's feeding thread is used
it is the user's responsibility to ensure that the thread won't use
the frontend past stop. Joining the thread is one possible way to do it.

Fixes https://github.com/boostorg/log/issues/131.
2020-09-27 19:44:08 +03:00
Andrey Semashev
d98067a0ed Explicitly specify PP_REPEAT nesting level to nested Boost.Preprocessor macros.
This adds a Boost.Log-side workaround for a bug in the new MSVC-14.2
preprocessor enabled with /Zc:preprocessor. The bug still affects other
libraries, like Boost.Phoenix.

This change may also improve preprocessing speed.

Related to https://github.com/boostorg/preprocessor/issues/33.
Related to https://github.com/boostorg/log/issues/126.
2020-09-09 23:56:02 +03:00
Andrey Semashev
3891a7fad9 Fixed running CI on feature branches. 2020-09-09 15:13:20 +03:00
Andrey Semashev
99abc451d7 Work around clang 3.6 compilation error in attachable_sstream_buf.
It looks like the compiler has a bug that prevents it from finding
attachable_sstream_buf::append that takes a pointer as the first
argument.

This commit disables __builtin_assume for the compiler. The builtin
was enabled recently and triggered the bug.
2020-09-09 12:47:47 +03:00
Andrey Semashev
84b82a4de4 Removed BOOST_LOG_ASSUME postulating that a reference is not null.
Normally, this should be inferred by compiler, as references are not
allowed to be null. This silences a clang-cl warning.
2020-09-08 18:28:06 +03:00
Andrey Semashev
de4e85e9b3 Switched to c++-template-depth feature instead of explicit compiler flags.
This allows to specify the limit for other compilers that support it
and remove it for clang-cl, which doesn't.
2020-09-08 18:23:57 +03:00
Andrey Semashev
4ef885fc7a Moved MSVC C/C++ runtime deprecated macros to a common place.
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.
2020-09-08 18:20:13 +03:00
Andrey Semashev
4485deb0c7 Added definition of BOOST_LOG_ASSUME for clang.
clang supports __builtin_assume starting with clang 3.6.
2020-09-08 16:07:35 +03:00
Andrey Semashev
ac3beeb097 Make clang-cl use gcc-style warning pragmas and disable __assume warnings.
Closes https://github.com/boostorg/log/issues/127.
2020-09-08 16:02:39 +03:00
Andrey Semashev
0505022c77 Replaced volatile version counter in basic_sink_frontend with an atomic.
This should silence clang-cl warnings about deprecated uses of volatile.

Note that the previous code, although not conforming to the standard C++
memory model, did not have a problem in practice, since all relevant
architectures implement plain aligned 32-bit loads and stores atomically.
The code only modifies the counter under a mutex lock, so the atomic
is only needed to prevent load/store slicing.

Closes https://github.com/boostorg/log/issues/128.
2020-09-08 15:15:22 +03:00
Andrey Semashev
b4399c0407 Moved SSSE3/AVX2 compiler flag deduction to a common submodule.
Also, use gcc-style command line arguments by default as most compilers
tend to support them.

Marked config obj targets explicit.
2020-09-08 02:50:08 +03:00
Andrey Semashev
f1108cdb0c Fixed Jamfile and made config messages more human-friendly. 2020-09-07 11:00:50 +03:00
Andrey Semashev
48d2319d7b Added gcc-like SSSE3/AVX2 flags for qcc.
Presumably, qcc is based on gcc, so it should accept the same flags.
2020-09-07 01:11:37 +03:00
Andrey Semashev
54c307ebed Removed unused includes. 2020-09-03 11:58:58 +03:00
Andrey Semashev
f319a186ad Reverted gcc-10 to Ubuntu Bionic because of ICE in Boost.Xpressive. 2020-08-21 20:18:08 +03:00
Andrey Semashev
7344ce3cda Switch gcc-10 and clang-10 to Ubuntu Focal; clang-9 to Ubuntu Bionic.
Also enabled CI for feature branches.
2020-08-21 15:19:17 +03:00
Andrey Semashev
dd5a8f1b41 Fixed file counter in the target filename generated by text file backend.
The file counter gets incremented when a new file is opened. Since the
target filename was generated later, on file rotation, the target filename
got the next value of the counter. This caused some values of the counter
being skipped when the application restarts and scans for the previous
log files.

Fixes https://github.com/boostorg/log/issues/125.
2020-08-20 19:57:21 +03:00
Andrey Semashev
e7d4fd2d13 Include config.hpp before checking BOOST_LOG_WITHOUT_SYSLOG.
Boost.Log's config.hpp may define BOOST_LOG_WITHOUT_SYSLOG if no native
syslog API or Boost.ASIO is available, so we need to include the header
before checking the macro.

Closes https://github.com/boostorg/log/pull/123.
boost-1.74.0
2020-08-01 21:59:33 +03:00
Andrey Semashev
027c334063 Marked system library targets explicit. boost-1.74.0.beta1 2020-06-08 01:06:59 +03:00
Andrey Semashev
2b28f477c5 Disable gcc warnings about ignoring attributes on _SECURITY_ATTRIBUTES. 2020-06-07 19:09:46 +03:00
Andrey Semashev
477c766384 Added a FreeBSD job in Travis CI. 2020-06-07 00:51:32 +03:00
Andrey Semashev
2e93f7d86e Added gcc 10 build jobs to Travis CI. 2020-05-22 18:25:47 +03:00
Andrey Semashev
76baf3fd3e Added notes about lifetime of objects used with manipulators. 2020-05-13 19:53:32 +03:00
Andrey Semashev
00b051011c Removed unnecessary check for stream being good.
The stream will be checked in the operator<< of the value anyway, and we don't
save much performance by checking the stream before invoking
optional_manipulator::output.
2020-05-12 11:25:55 +03:00
Andrey Semashev
65037a0c2f Added optional_manip output manipulator for formatting optional values. 2020-05-12 01:34:46 +03:00
Andrey Semashev
a2cb720ed1 Added tuple_manip output manipulator for formatting heterogeneous sequences. 2020-05-12 01:33:36 +03:00
Andrey Semashev
15f5f4ed58 Added range_manip output manipulator for formatting ranges. 2020-05-11 23:37:30 +03:00
Andrey Semashev
d4db5c3937 Upgraded UBSAN to clang 10.
https://github.com/boostorg/xpressive/pull/13 has been merged, which means
Boost.Xpressive issue should be fixed.
2020-05-10 23:33:02 +03:00
Andrey Semashev
e675ff1171 Marked keywords as inline variables. 2020-05-10 19:28:48 +03:00
Andrey Semashev
157e45ef0a Downgrade UBSAN to clang 9 to work around the bug in Boost.Xpressive. 2020-05-08 02:44:57 +03:00
Andrey Semashev
8c12f2305e Added a release note about added noexcept markup. 2020-05-07 21:31:23 +03:00
Andrey Semashev
9a85efde08 Added noexcept specifiers. Made logger move ctors more noexcept-friendly.
Logger move constructors don't need to add the attributes to the logger
attributes since the latter are moved from the source logger, just as the
attributes. This allows move constructors to be noexcept, provided that
they are non-noexcept for other reasons.

Closes https://github.com/boostorg/log/issues/121.
2020-05-07 20:35:14 +03:00
Andrey Semashev
706fed3bf4 Avoid unnecessary copy of the filename string. 2020-05-07 17:48:38 +03:00
Andrey Semashev
4d16fb6608 Disable UBSAN tests in C++20 mode to work around Boost.Xpressive bug.
UBSAN inticates test failures caused by Boost.Xpressive. To be fixed by:

https://github.com/boostorg/xpressive/pull/13
2020-05-07 17:34:42 +03:00
Andrey Semashev
89d1ff541d Added clang-10 jobs to Travis CI. 2020-05-05 23:06:33 +03:00
Andrey Semashev
a79103cb3d Removed linking with Boost.DateTime.
Boost.DateTime is now header-only.
2020-05-05 14:41:56 +03:00
Andrey Semashev
9b6422cdad Merge pull request #120 from EugeneZelenko/use-boost-override
Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy moder…
2020-05-04 17:20:07 +03:00
Eugene Zelenko
4019d171a3 Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings. 2020-05-03 20:29:19 -07:00
Andrey Semashev
112d6f0fbc Changed macro checks in the footer to match the header. 2020-05-02 18:50:08 +03:00
Andrey Semashev
1e92e84b80 Added checking for IP version in addresses in syslog backend.
The syslog sink backend now verifies the IP version of the local and target
addresses set by user. The addresses must have the same IP version as was
specified in the ip_version named parameter on the sink backend construction.
When an address is obtained as a result of host name resolution, only addresses
with matching IP version are considered.

This should protect against using local and target addresses with mismatching
IP versions, which results in errors on sending datagrams.

Fixes https://github.com/boostorg/log/issues/119.
2020-04-27 21:47:41 +03:00
Andrey Semashev
49af1c8fa0 Use SFINAE to limit attribute set iterator comparison, copy and assignment.
This makes the code more SFINAE-friendly. It also changes the converting
constructor and assignment operator to only work as converting constructor and
assignment and let the compiler generate the implicit copy constructor and
assignment operator. This should silence bogus clang-10 warnings about
deprecated generation of an implicit copy assignment operator in presence of
a copy constructor. (The warning is bogus because there already is an explicitly
defined assignment operator, which works as a copy assignment as well.)

Closes https://github.com/boostorg/log/issues/118.
boost-1.73.0
2020-04-20 20:30:17 +03:00
Andrey Semashev
c068c2a5aa Add explicit markup of fallthrough between switch/case labels.
Silences some compiler warnings.

Closes https://github.com/boostorg/log/issues/115.
2020-04-14 00:29:14 +03:00
Andrey Semashev
43b944da2e Added a workaround for MSVC 14.2 codegen bug in regex matching filters.
The compiler generates incorrect code causing a crash if it inlines the
`matches` generator functions, when a Boost.Regex regular expression is passed
as an argument.

https://developercommunity.visualstudio.com/content/problem/982738/bad-code-generated-in-boostlogboostregex-test-case.html

As a workaround we prohibit inlining these functions on this compiler.

Fixes AppVeyor CI test failures.
2020-04-08 15:32:33 +03:00
Andrey Semashev
ea0dd6171b Merge pull request #112 from Nekto89/filesystem_no_deprecated
Add missing filesystem includes.
boost-1.73.0.beta1
2020-04-03 21:54:57 +03:00
Marian Klymov
e6c6479d91 Add missing filesystem includes.
Fix compilation with BOOST_FILESYSTEM_NO_DEPRECATED
2020-04-03 18:55:34 +03:00
Andrey Semashev
2113f04d60 Minor tweak for README.md. 2020-03-10 22:34:34 +03:00