boost::logging::formatter::named_spacer_t< convert, format_base, lock_resource > Struct Template Reference
Allows you to contain multiple formatters, and specify a spacer between them. You have a spacer string, and within it, you can escape your contained formatters.
More...
List of all members.
Detailed Description
template<class convert = default_, class format_base = default_, class lock_resource = default_>
struct boost::logging::formatter::named_spacer_t< convert, format_base, lock_resource >
Allows you to contain multiple formatters, and specify a spacer between them. You have a spacer string, and within it, you can escape your contained formatters.
#include <boost/logging/format/formatter/named_spacer.hpp>
This allows you:
- to hold multiple formatters
- each formatter is given a name, when being added
- you have a spacer string, which contains what is to be prepended or appended to the string (by default, prepended)
- a formatter is escaped with
'%'
chars, like this "%name%"
- if you want to write the
'%'
, just double it, like this: "this %% gets written"
Example:
Assuming you'd use the above in code
int i = 1;
L_ << "this is so cool " << i++;
L_ << "this is so cool again " << i++;
You could have an output like this:
[1] 53 (T3536) this is so cool 1
[2] 54 (T3536) this is so cool again 2
- Bug:
- Use_tags.cpp example when on dedicated thread, fails with named_spacer. If using the old code, it works.
- Examples:
-
using_tags.cpp.
The documentation for this struct was generated from the following file:
- format/formatter/named_spacer.hpp
Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback