2

I am new to Boost.Log in my c++ program. I create a logger called "simlog" and then I use following line to output my log text:

BOOST_LOG( simlog ) << "some log info";

I don't want the default endl be appended to each of statement like this. I'd rather control whether to add a endl or not myself. How do I do that with Boost.Log? Is there a format setting to turn it on/off?

Wuwen Li
  • 81
  • 1
  • 6

1 Answers1

0

It cannot be done with the out-of-the-box features of Boost.Log. However, you can define a custom sink backend, implement do_consume method and output log message there without trailing \n.

For more information on custom sink backends look here: Writing your own sinks.

Alex Blekhman
  • 3,875
  • 2
  • 19
  • 18