boost::logging::formatter::time_t< convert > Struct Template Reference

Prefixes the message with the time. You pass the format string at construction. More...

Inheritance diagram for boost::logging::formatter::time_t< convert >:
[legend]
Collaboration diagram for boost::logging::formatter::time_t< convert >:
[legend]

List of all members.

Public Member Functions

 time_t (const hold_string_type &format)
void configure (const hold_string_type &str)
 configure through script


Detailed Description

template<class convert = do_convert_format::prepend>
struct boost::logging::formatter::time_t< convert >

Prefixes the message with the time. You pass the format string at construction.

It's friendlier than write_time_strf (which uses strftime).

The format can contain escape sequences: $dd - day, 2 digits $MM - month, 2 digits $yy - year, 2 digits $yyyy - year, 4 digits $hh - hour, 2 digits $mm - minute, 2 digits $ss - second, 2 digits

Example: time("Today is $dd/$MM/$yyyy");

Note: for a high precision clock, try high_precision_time (uses boost::date_time)

Parameters:
convert [optional] In case there needs to be a conversion between std::(w)string and the string that holds your logged message. See convert_format. For instance, you might use a cached_string class (see optimize namespace).
Examples:

ded_loger_one_filter.cpp, mul_loggers_one_filter.cpp, no_levels_with_route.cpp, and your_scenario.cpp.


Constructor & Destructor Documentation

template<class convert = do_convert_format::prepend>
boost::logging::formatter::time_t< convert >::time_t ( const hold_string_type &  format  )  [inline]

constructs a time object


Member Function Documentation

template<class convert = do_convert_format::prepend>
void boost::logging::formatter::time_t< convert >::configure ( const hold_string_type &  str  )  [inline, virtual]

configure through script

the string = the time format

Reimplemented from boost::logging::manipulator::is_generic.


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

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