The easy way, use Named Formatters and Destinations
You use a string to specify Formatters, and a string to specify Destinations. Thus, you use the writer::named_write.
First, the examples: example 1, example 2
std::(w)string. You'll use this when you want a optimize string class. Or, when using tagstypedef boost::logging::named_logger<>::type logger_type; and typedef your filter class
The manual way
First, the examples: example 1, example 2
std::(w)string. You'll use this when you want a optimize string class. Or, when using tags
This usage:
In this example, all output will be written to the console, debug output window, and "out.txt" file. It will look similar to this one:
21:03.17.243 [1] this is so cool 1
21:03.17.243 [2] first error 2
21:03.17.243 [3] hello, world
21:03.17.243 [4] second error 3
21:03.17.243 [5] good to be back ;) 4
21:03.17.243 [6] third error 5
Optimizations:
In this example, all output will be written to the console, debug window, and "out.txt" file. It will be:
[1] this is so cool 1 [2] this is so cool again 2 [3] hello, world [4] good to be back ;) 3
Here's what the output will be:
The console:
this is so cool
hello, world
good to be back ;)
The err.txt file:
first error second error
Optimizations:
Logs:
Here's how the output will look like:
The debug output window:
18:59.24 this is so cool 1 18:59.24 this is so cool again 2
The console:
18:59.24 this is so cool 1 18:59.24 this is so cool again 2 18:59.24 hello, world 18:59.24 good to be back ;) 4
The out.txt file:
18:59.24 hello, world 18:59.24 good to be back ;) 4
The err.txt file
18:59.24 [1] first error 3 18:59.24 [2] second error 5