boost::logging::formatter::spacer_t< convert, original_formatter, is_generic_formatter > Struct Template Reference

Prepends some info, and appends some info to an existing formatter. More...

List of all members.


Detailed Description

template<class convert, class original_formatter, bool is_generic_formatter>
struct boost::logging::formatter::spacer_t< convert, original_formatter, is_generic_formatter >

Prepends some info, and appends some info to an existing formatter.

The syntax is simple: construct a spacer by passing the original formatter, and the text to space (prepend and append). Use:

Examples:

// prefix "[" before index, and append "] " after it.
formatter::spacer( formatter::idx(), "[%] ");

// prefix "{T" before thread_id, and append "} " after it
formatter::spacer( formatter::thread_id(), "{T%} ");

When adding a spacer formatter, you'll do something similar to:

g_l()->writer().add_formatter( formatter::spacer( formatter::idx(), "[%] ") );

However, to make this even simpler, I allow an ever easier syntax:

// equivalent to the above
g_l()->writer().add_formatter( formatter::idx(), "[%] " );

The documentation for this struct was generated from the following file:

Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback