Questions tagged [boost-log]

The Boost C++ library for logging, focused on simplicity, extensibility and performance

336 questions
3
votes
1 answer

Can Boost Log be built as a .dll/.so in a static Boost build?

Is it possible to build Boost Log as a dynamic library (.dll/.so), but do so within a static Boost build? I'd like all the other Boost libraries to be static, and only Boost Log as a .dll (because several .dlls use it within the same…
Răzvan Cojocaru
  • 883
  • 9
  • 12
3
votes
1 answer

why Boost Log logger operations are not const?

I am trying to use a severity channel logger but I hit the problem with BOOST_LOG_SEV not being a const method -- I'm thinking because of both open_record() and push_record() This will basically force me to make all methods in my classes not const…
Carneiro
  • 3,479
  • 5
  • 24
  • 36
3
votes
1 answer

How does code in the boost::log tutorial work?

I haven't worked with C++ for some time, and I feel a little lost in the syntax. Could someone explain me the following lines from the boost::log library tutorial? logging::core::get()->set_filter ( logging::trivial::severity >=…
SathOkh
  • 826
  • 2
  • 12
  • 24
3
votes
2 answers

incorrect Boost Log timestamp format

I'm using Boost 1.54 Log and I initialize my logging in the following way: namespace logging = boost::log; namespace src = boost::log::sources; namespace expr = boost::log::expressions; namespace sinks = boost::log::sinks; namespace attrs =…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
3
votes
1 answer

Boost Log changing the default logging::core formatter?

I'm using Boost v1.54 and I would like to simply change the default sink format of logging::core but haven't found a way to do so. In the Log Record Formatting documentation they only show how to change the format for custom sinks e.g. log files and…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
3
votes
3 answers

what's Boost log "debug output window"?

I have been skimming through the Boost.Log tutorials and documentation and in all examples they refer to the "debugger window" or the "debug output window" but I could not find what that is. Is this some sort of standalone application? Where can I…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
3
votes
1 answer

boost for android building boost log

I am trying to build boost 1.54 for android. I am able to do it for date_time, filesystem, regex, program_options, signals, system and thread libraries of boost. But if I add boost log library among these, build fails as saying 'failed updating 8…
gokhans
  • 210
  • 2
  • 12
3
votes
2 answers

Boost + Mingw-w64 + Boost log won't work

I've got boost compiled, cmake working, and everything is close to working, yet the simplest of examples (trivial logging) fails to compile with a linker error. I really don't know what to do. Here is my current CMake setup FIND_PACKAGE(Boost…
Cogman
  • 2,070
  • 19
  • 36
3
votes
2 answers

How can I redirect output to a boost log?

I have a C++ program that uses boost log, and I load a user-provided dynamic link library. I'd like to redirect stderr to the boost log, so that anytime the user's library does: std::cerr << "Some stuff"; It produces the same result**…
Dave Lillethun
  • 2,978
  • 3
  • 20
  • 24
3
votes
0 answers

Is there a way to prevent boost.log from leaking memory?

I have created a very simple test program based off the boost.log tutorial: #include #define LOG_TRACE BOOST_LOG_TRIVIAL(trace) #define LOG_DEBUG BOOST_LOG_TRIVIAL(debug) #define LOG_INFO BOOST_LOG_TRIVIAL(info) #define…
BD at Rivenhill
  • 12,395
  • 10
  • 46
  • 49
3
votes
2 answers

Using boost.log with printf-style macros

I'm working on an application that uses an custom, platform-dependent logger. The application defines some printf-style macros: #define LOG_DEBUG(format, ...) \ logger.log(DEBUG, __FUNCTION__, format, ##__VA_ARGS__) ... The past few days I've…
jwalk
  • 1,120
  • 11
  • 27
2
votes
1 answer

boost log tutorial trivial logging example does not link on VS2010

#include int main(int, char*[]) { BOOST_LOG_TRIVIAL(trace) << " a trace message "; } Unresolved external symbols to boost::system, filesystem3, coecvt. Oddly the examples\basic_usage and multiple_threads link and work…
John
  • 541
  • 4
  • 13
2
votes
2 answers

Conan + CMake + C++ : Linking against Boost.Log static library fails

I am trying to set up a basic Boost.Logging demo project, with Conan and CMake. I'm using Conan 1.53.0 and CMake 3.22.1, with gcc-11.3.0, on Ubuntu 22.04.1. First, I use Conan to bring in Boost 1.81, thus my…
davidA
  • 12,528
  • 9
  • 64
  • 96
2
votes
1 answer

Boost Log + Log rotation in another folder

is there a possibility, to write with Boost Log the history log files in another folder than the current log file? log trace_2.log history trace_0.log trace_1.log I'm using an asynchronous sink and tried it via set_file_collector, but all…
2
votes
1 answer

Boost.Log, using custom attributes in filename or target value of configuration file

I use Boost.Log in C++ to log, and use configuration files. I added some custom attributes and use them in the configuration file. Here is the registration of the attributes in C++: namespace logging = boost::log; namespace attrs =…
Joel
  • 669
  • 7
  • 25