Public Member Functions | |
| named_t (const string_type &format_string=string_type()) | |
| constructs the named destination | |
This allows you:
The format string contains destination names, separated by space.
When a message is written to this destination, I parse the format string. When a name is encountered, if there's a destination corresponding to this name, I will call it.
Example:
g_l()->writer().add_destination(
destination::named("cout out debug")
.add( "cout", destination::cout())
.add( "debug", destination::dbg_window() )
.add( "out", destination::file("out.txt"))
);
In the above code, we'll write to 3 destinations, in the following order:
This is useful if you want to set this format string in a config file. The good thing is that this way you can easily turn on/off certain destinations, while seing all the available destinations as well.
Example:
+out_file -debug_window +console
In the above example, I know that the available destinations are out_file, debug_window and console, but I'm not writing to debug_window.
#include <boost/logging/format/destination/named.hpp>
| boost::logging::destination::named_t< destination_base, lock_resource >::named_t | ( | const string_type & | format_string = string_type() |
) | [inline] |
constructs the named destination
| named_name | name of the named | |
| set | [optional] named settings - see named_settings class, and Dealing with flags. |