The Boost C++ library for logging, focused on simplicity, extensibility and performance
Questions tagged [boost-log]
336 questions
0
votes
2 answers
Boost::log: Different formatting based on level (HTML formatted)
I'm working on the basic boost example from here. I'm configuring what I need for my application, but I'm stuck. Here's where I am now:
#include
#include
#include
#include…

The Quantum Physicist
- 24,987
- 19
- 103
- 189
0
votes
1 answer
Boost Log V2 rotation keep one file as "master"
I'm using the Boost Log V2 to create log files from my application.
I have configured the log file to rotate by size using this naming configuration:
keywords::file_name = "application_%N.log",
keywords::rotation_size = 5 * 1024 *…

Amir Rossert
- 226
- 2
- 15
0
votes
0 answers
Are multi-threaded version of boost libraries with -mt suffix still supported?
My application that is developed using CMake and boost library on Linux (openSUSE-Leap-42.2) needs libboost_log-mt.so (1.62) while linking. But the problem is that CMake cannot find this library (with -mt suffix) in my lib directory even when I use…

TonySalimi
- 8,257
- 4
- 33
- 62
0
votes
1 answer
Boost logging text_file_backend doesn't have wchar_t version?
class SeverityLevelFormatter {
private:
mutable boost::wformat format_;
public:
SeverityLevelFormatter(const std::wstring& format) : format_(format) {
}
void operator() (logging::wformatting_ostream& strm, const…

user1633272
- 2,007
- 5
- 25
- 48
0
votes
1 answer
How to call sink->imbue when using boost::log::init_from_settings?
How to call sink->imbue for text file sink when using init_from_settings?
I checked the source code and didn't find a way to re-access those sinks.
Seems that register_sink_factory is the extension, but the default factories are all in…

user1633272
- 2,007
- 5
- 25
- 48
0
votes
0 answers
Using Boost::Log for Logging Socket Communication
I am looking to asynchronously log the socket data that flows between the client and the server via a tcp proxy server.
I wasn't able to find enough details on tapping to the buffer and writing to a log sink. Any help ?
Below is the Boost:ASIO code…

VidhyaS
- 31
- 3
0
votes
1 answer
Error compiling Boost.Log
I am trying to compile the boost log library and I keep getting this error from the dump_avx2.cpp file
error: always_inline function '_mm256_set1_epi32' requires target feature 'sse4.2', but would be inlined into function 'dump_data_avx2' that is…

Curious
- 20,870
- 8
- 61
- 146
0
votes
2 answers
How do you disable auto-flush for Boost Log
I am using Boost.Log to log various sets of data to different files. I would like to have the auto_flush feature enabled for some files, but disabled for others (so that a newline is not inserted on each consecutive log statement). I couldn't get…

Kevin
- 16,549
- 8
- 60
- 74
0
votes
1 answer
boost::log format doesn't work when called from DLL
I used to format output of boost::log in a DLL of mine, named libfoo and used by a Win32 console application exefoo. Code is
// #include various boost log headers
void __declspec(dllexport) add_boost_log_console_sink()
{
…

Patrizio Bertoni
- 2,582
- 31
- 43
0
votes
1 answer
Can I access the stream instance used by BOOST_LOG_TRIVIAL?
Is it possible to access the underlying stream instance used by BOOST_LOG_TRIVIAL?
I'm trying to have BOOST unit test framework write output using BOOST_LOG_TRIVIAL (which I have configured to write in a file and std::clog)
auto& log_stream = ??? //…

Florin Neamtu
- 25
- 1
- 6
0
votes
1 answer
Can I copy a Boost::Log sink and change it?
I'm currently creating a log sink that dumps log lines from the output of my Trainer class to cout:
using namespace boost;
using namespace log; …

quant
- 21,507
- 32
- 115
- 211
0
votes
0 answers
Boost Log library crashes with basic example
I am trying to setup logging using boost in my project and I am spending some time to learn the library. However a simple example, taken from the official tutorial crashes.
#include
int main(int, char*[])
{
…

cateof
- 6,608
- 25
- 79
- 153
0
votes
2 answers
boost log non-const bitfield compilation error (backward compatibility issue)
I took the example from http://www.boost.org/doc/libs/1_61_0/libs/log/example/doc/tutorial_trivial_flt.cpp and added a bitfield print:
#include
#include
#include
namespace…

o.z
- 1,086
- 14
- 22
0
votes
1 answer
How do I combine two boost logging macros that generate unique identifiers?
I am using boost_logging (version 2), and I would like to avoid littering these throughout my code:
BOOST_LOG_NAMED_SCOPE("SomeModuleName")
BOOST_LOG_FUNCTION()
My thinking this second is that I'd prefer to combine them in a macro like…

Merlyn Morgan-Graham
- 58,163
- 16
- 128
- 183
0
votes
1 answer
Boost Log cut long log messages
Is there a possibility in boost::log to consider only a part of the log message if it is too long (e.g. 1000 characters)? This would be useful when tracing variable content, where the entirety of it is not mandatory to figure out the information…

Alexandru Irimiea
- 2,513
- 4
- 26
- 46