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

93 Commits

Author SHA1 Message Date
Andrey Semashev
ad2eb6c4e5 Added docs, examples and test for wrap_formatter. 2025-07-11 10:28:46 +03:00
Andrey Semashev
86c8cdcced Added a wrap_filter utility.
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.
2025-07-11 03:23:01 +03:00
Andrey Semashev
26c93dc061 Replaced Boost.Thread synchronization primitives with std equivalents.
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.
2024-08-16 20:01:18 +03:00
Andrey Semashev
a268b41149 Added a new invoke stream manipulator.
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.
2022-02-27 05:43:11 +03:00
Andrey Semashev
8024d7c9c9 Enabled matches with Boost.Xpressive test for gcc 11.2 and newer.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293 is fixed in gcc 11.2.
2021-12-02 17:57:04 +03:00
Andrey Semashev
c9b6e2b191 Include Boost.WinAPI config first in tests involving Boost.Regex.
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
2021-09-18 03:02:46 +03:00
Andrey Semashev
151d89dd2f Added a workaround for MSVC 8-11 ICE in util_ipc_reliable_mq test. 2021-09-15 23:58:41 +03:00
Andrey Semashev
1ff5a815d4 Fixed include. 2021-09-13 18:13:24 +03:00
Andrey Semashev
6bbe7b90e3 Generate unique IPC queue name in util_ipc_reliable_mq test.
This allows to run multiple instances of the test concurrently in GitHub
Actions CI, e.g. debug and release.

This was also reported in https://github.com/boostorg/log/issues/162.
Closes https://github.com/boostorg/log/issues/162.
2021-09-13 17:56:34 +03:00
Andrey Semashev
ef7476d006 Disable Boost.Xpressive tests on gcc 10+ in C++03 mode.
The compiler ICEs on Boost.Xpressive code in C++03 mode.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293
2021-09-12 23:28:55 +03:00
Andrey Semashev
699fcc1281 Made channel loggers deep-copy the channel attribute on copy ctor/assignment.
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.
2021-02-10 14:45:52 +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
68d38321b3 Updated deprecated uses of boost::bind to silence warnings. 2020-03-04 00:44:23 +03:00
Andrey Semashev
959a97c38b Avoid using deprecated Boost.Test headers. 2019-10-23 13:29:50 +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
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
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
67eef1afba Switch to uncaught_exceptions from Boost.Core.
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.
2018-12-17 19:21:25 +03:00
Andrey Semashev
adb7bcf05d Removed the previously deprecated type_info_wrapper. 2016-10-16 17:47:15 +03:00
Andrey Semashev
ea486c1468 Take scalar types and enums by value in streaming operators.
This allows to output static constants and bitfields directly into
formatting stream and record stream. Fixes ticket #11998.
2016-10-08 22:27:34 +03:00
Andrey Semashev
6995fd05b3 Silence MSVC warnings about truncating floating point constants. 2016-08-09 13:36:38 +03:00
Andrey Semashev
29347b2ae5 Silence MSVC warnings about truncating character bytes in UTF-8 literals. 2016-08-09 13:27:25 +03:00
Andrey Semashev
70debc533b Changed the max_size decorator so that the overflow marker length is
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.
2016-08-09 04:20:49 +03:00
Andrey Semashev
f15e9d413c Fixed #12178. Stream formatting parameters could be preserved across different log records. 2016-07-17 16:31:24 +03:00
Andrey Semashev
1699351a8b Use the size_type typedef in the autotest. 2016-04-14 19:32:04 +03:00
Andrey Semashev
85092ef741 Added a new queue overflow policy which allows to return an error code if the queue is full. Added a test for the new policy. Changed the interface slightly to use the common message size typedef and use this typedef to check the message size before enqueueing it. 2016-04-14 19:32:04 +03:00
Andrey Semashev
6c49eccaa2 Added another thread to the test. Just to make it more likely to detect issues. 2016-04-14 19:32:04 +03:00
Andrey Semashev
38aeadfcc1 Fixed a few bugs in interprocess condition variable on Windows which caused infinite waits in some cases. 2016-04-14 19:32:04 +03:00
Andrey Semashev
95704fccca Added memory fences to guarantee that the thread-specific data is properly visible to other threads. 2016-04-14 19:32:04 +03:00
Andrey Semashev
5da7f8cf55 Added a test for from_native. 2016-04-14 19:32:04 +03:00
Andrey Semashev
05826649a0 Extracted platform-specific logic regarding interprocess object names to a separate object_name wrapper. Use this wrapper wherever interprocess queue name was used. Added a test for the wrapper. Extracted auto_handle to a separate header. 2016-04-14 19:32:04 +03:00
Andrey Semashev
48079e0fcb Renamed stop() and reset() to stop_local() and reset_local() to emphasize that the methods operate only on the local queue object. Added proper documentation for the class. 2016-04-14 19:32:04 +03:00
Andrey Semashev
89d56bc12a Compilation fixes on Windows. 2016-04-14 19:32:03 +03:00
Andrey Semashev
1aacc3e746 Fixed bugs, updated tests. 2016-04-14 19:32:03 +03:00
Andrey Semashev
2ad2ad2520 Added a check for throwing an exception on queue overflow. 2016-04-14 19:32:03 +03:00
Andrey Semashev
f47a77ab9b Reworked reliable message queue test. 2016-04-14 19:32:03 +03:00
Andrey Semashev
b38f3b915a Working on separating tests for the IPC sink backend and message queue. 2016-04-14 19:32:03 +03:00
Andrey Semashev
2a19a66559 Renamed sink_ipc_backend.cpp -> sink_text_ipc_mq_backend.cpp. Working on separating tests for the IPC sink backend and message queue. 2016-04-14 19:32:03 +03:00
Andrey Semashev
0cc56f385e Trim trailing spaces. 2016-04-14 19:32:02 +03:00
Lingxi-Li
8d9002cab8 Add text_ipc_message_queue_backend
This new sink backend supports logging messages to an interprocess
message queue.
2016-04-14 19:32:02 +03:00
Andrey Semashev
2f6facfdcd Silenced signed/unsigned mismatch warnings. 2016-02-25 21:26:04 +03:00
Andrey Semashev
30fcf0ef2d Renamed all uses of basic_string_ref to basic_string_view to follow Boost.Utility. 2015-12-23 01:58:20 +03:00
Andrey Semashev
b7de827f23 Fixed compilation of character decorators. Added tests. 2015-09-26 19:20:07 +03:00
Andrey Semashev
44ef109505 Fixed #11541. Fixed compilation when native wchar_t type is disabled. Added a note of discouragement to the configuration section. 2015-08-23 20:30:30 +03:00
Andrey Semashev
7da193fde1 Fixed compilation of operator<< into a record ostream, when the operator right hand argument is not directly supported by formatting_ostream. Fixed #11549. 2015-08-23 17:27:20 +03:00
Andrey Semashev
ac70fa34c1 Removed use of auto_ptr. 2015-07-18 20:32:07 +03:00
Andrey Semashev
12fb58fd54 Removed unused typedef. 2015-07-06 11:59:58 +03:00