Questions tagged [boost-log]

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

336 questions
6
votes
1 answer

Boost.Log vs. Boost.Log v2

I am currently evaluating some log frameworks for unmanaged C++. My question is: what is the difference between Boost.Log and Boost.Log v2? Is the Api is different? Is it safe to use Boost.Log v2 in a project or should I stick with Boost.Log…
cprogrammer
  • 5,503
  • 3
  • 36
  • 56
6
votes
1 answer

How to output TimeStamp and ThreadID attributes with custom boost::log formatter?

I'm using custom boost::log formatter for color coding the output log message, but I'm failing to find the proper way to add TimeStamp and ThreadID attributes to the log. When I'm using file logging I just write keywords::format = "[%TimeStamp%]…
bobeff
  • 3,543
  • 3
  • 34
  • 62
6
votes
1 answer

Problems Linking boost log 1_60 with MinGw on Windows 7

On upgrading to boost 1.60.0 some applications are failing to link with boost log when built with MinGw 4.9.2 on Windows 7. I get the following linker errors: undefined reference to `_imp___ZN5boost3log9v2_mt_nt67trivial6logger3getEv' undefined…
kenba
  • 4,303
  • 1
  • 23
  • 40
6
votes
2 answers

Properly overload operator << in Boost.Log

In the Boost.Log documentation, it is said that Note The library uses basic_formatting_ostream stream type for record formatting, so when customizing attribute value formatting rules the operator<< must use basic_formatting_ostream instead of …
Lingxi
  • 14,579
  • 2
  • 37
  • 93
6
votes
1 answer

Problems with boost log, version 1.59

The following code works as expected with boost 1.57: #include #include struct Foo { int d=1; }; std::ostream& operator<<(std::ostream& out, const Foo& foo) { out << "Foo: " << foo.d; return…
Marios V
  • 1,174
  • 9
  • 15
6
votes
1 answer

Get severity of boost.log logger..?

Suppose I have a simple boost.log severity_logger logger set up like this: logging::core::get()->set_filter(logging::trivial::severity >= logging::trivial::debug); logging::add_common_attributes(); src::severity_logger<…
cacau
  • 3,606
  • 3
  • 21
  • 42
6
votes
2 answers

How can I manually flush a boost log?

I'm playing with Boost.Log in boost 1.54.0 to see if it is a viable option for my application. In general, I don't have a problem with the buffering, so I'm not looking to turn on auto_flush or anything... but I noticed that messages that are logged…
Dave Lillethun
  • 2,978
  • 3
  • 20
  • 24
6
votes
4 answers

Enable Boost.Log only on debug

I need a logger for debug purpose and I'm using Boost.Log (1.54.0 with a patch in the boost.org homepage). It's all fine I've created some macro like this: #define LOG_MESSAGE( lvl ) BOOST_LOG_TRIVIAL( lvl ) Now is that a way that LOG_MESSAGE( lvl…
Elvis Dukaj
  • 7,142
  • 12
  • 43
  • 85
5
votes
0 answers

'boost_log_abi': value 'v2s_mt_nt6' doesn't match value 'v2s_mt_nt5'

I am linking a C++ console application with Boost. Everything was fine till I start using Boost logging library. I am facing this issue: boost_log_abi': value 'v2s_mt_nt6' doesn't match value 'v2s_mt_nt5 I tried everything in this question.…
Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
5
votes
1 answer

boost::log close log file and open a new one

I'm using boost::log to simultaneously log to a file as well as the console. It's initialized like so: void Init() { logging::core::get()->set_filter ( // set logging level to one of trace, debug, info, warning, error, fatal …
Aurelius
  • 1,146
  • 2
  • 13
  • 25
5
votes
1 answer

Boost::Log and log numbering

I've recently tried to add some logging via Boost log to a small application. However, using log rotation I can't for some reason get it to pick up the correct counter in the logs directory. For example, if my Logs directory contains the files…
Dave F
  • 973
  • 9
  • 19
5
votes
2 answers

Yocto 1.6 no libboost_log in toolchain

I've installed Yocto 1.6 and run the bitbake to set up the toolchain, following the tutorial written by Daiane Angolini. While I see most of the boost libraries under $SDKTARGETSYSROOT/usr/lib, there seems to be no libboost_log.a nor…
Theanderblast
  • 191
  • 1
  • 5
5
votes
1 answer

Simultaneous Logging to Console and File using Boost

I need help to initialize the boost logging framework to simultaneously log to both a named log file and also the console - (the named log file will not require periodic rotation or any of that fancy setup per many of the boost tutorials). The…
johnco3
  • 2,401
  • 4
  • 35
  • 67
5
votes
2 answers

g++ static link error against Boost.Log

I get link errors when statically linking against Boost.Log. The compiler version is g++ 4.8.1. Boost version is 1.55.0. I can do a dynamical link without problems (with a "-DBOOST_LOG_DYN_LINK" in make file) but when I do the static link, I get…
avhacker
  • 667
  • 1
  • 9
  • 20
4
votes
1 answer

How to define output stream operator for boost log and a custom type

I was able to define the output stream operator for a simple struct, however, not for std::array. The following code fails to compile. What is wrong and how can I fix it? #include #include #include #include…
Andrew Dwojc
  • 119
  • 10
1 2
3
22 23