#include <SystemLogger.h>
Public Types | |
typedef _CharT | char_type |
typedef _Traits | traits_type |
typedef std::basic_streambuf < char_type, traits_type > | __streambuf_type |
typedef std::basic_filebuf < char_type, traits_type > | __filebuf_type |
Public Member Functions | |
basic_medlogbuf () | |
Constructor. | |
basic_medlogbuf (__filebuf_type &filebuf) | |
Constructor. | |
basic_medlogbuf (const basic_medlogbuf &x) | |
basic_medlogbuf copy constructor. | |
virtual | ~basic_medlogbuf () |
Destractor. | |
void | setBuffer (__filebuf_type &filebuf) |
Set the log buffer. | |
void | setDateFmt (char *fmt) |
Set date/time format for adding the header. | |
void | setDateFmt (const std::string &fmt) |
Set date/time format for adding the header. | |
std::string | getFmtDate () |
Get the current formatted date/time string. | |
void | setSuffix (char *suffix) |
Set suffix of date/time string of header. | |
void | setSuffix (const std::string &suffix) |
Set suffix of date/time string of header. | |
std::string | getSuffix () |
Get suffix of date/time string of header. | |
Protected Member Functions | |
virtual int | sync () |
synchronization of buffer |
This is a logger buffer class like basic_streambuf. Mediates to basic_filebuf. Add the header etc to the string received from stream and pass it to basic_filebuf.
typedef _CharT RTC::basic_medlogbuf< _CharT, _Traits >::char_type |
typedef _Traits RTC::basic_medlogbuf< _CharT, _Traits >::traits_type |
typedef std::basic_streambuf<char_type, traits_type> RTC::basic_medlogbuf< _CharT, _Traits >::__streambuf_type |
typedef std::basic_filebuf<char_type, traits_type> RTC::basic_medlogbuf< _CharT, _Traits >::__filebuf_type |
RTC::basic_medlogbuf< _CharT, _Traits >::basic_medlogbuf | ( | ) | [inline] |
Constructor.
Constructor
RTC::basic_medlogbuf< _CharT, _Traits >::basic_medlogbuf | ( | __filebuf_type & | filebuf | ) | [inline] |
Constructor.
Constructor
filebuf | Buffer for log file |
RTC::basic_medlogbuf< _CharT, _Traits >::basic_medlogbuf | ( | const basic_medlogbuf< _CharT, _Traits > & | x | ) | [inline] |
basic_medlogbuf copy constructor.
virtual RTC::basic_medlogbuf< _CharT, _Traits >::~basic_medlogbuf | ( | ) | [inline, virtual] |
Destractor.
Destructor
void RTC::basic_medlogbuf< _CharT, _Traits >::setBuffer | ( | __filebuf_type & | filebuf | ) | [inline] |
Set the log buffer.
Set the specified file buffer as log buffer.
filebuf | Buffer for log file |
void RTC::basic_medlogbuf< _CharT, _Traits >::setDateFmt | ( | char * | fmt | ) | [inline] |
Set date/time format for adding the header.
The format specification string is as follows:
%a abbreviated weekday name %A full weekday name %b abbreviated month name %B full month name %c the standard date and time string %d day of the month, as a number (1-31) %H hour, 24 hour format (0-23) %I hour, 12 hour format (1-12) %j day of the year, as a number (1-366) %m month as a number (1-12). Note: some versions of Microsoft Visual C++ may use values that range from 0-11. %M minute as a number (0-59) %p locale's equivalent of AM or PM %S second as a number (0-59) %U week of the year, sunday as the first day %w weekday as a decimal (0-6, sunday=0) %W week of the year, monday as the first day %x standard date string %X standard time string %y year in decimal, without the century (0-99) %Y year in decimal, with the century %Z time zone name %% a percent sign
fmt | Datetime format |
void RTC::basic_medlogbuf< _CharT, _Traits >::setDateFmt | ( | const std::string & | fmt | ) | [inline] |
Set date/time format for adding the header.
For more details on the format specification string, please refer to void setDateFmt(char*).
fmt | Datetime format string |
std::string RTC::basic_medlogbuf< _CharT, _Traits >::getFmtDate | ( | ) | [inline] |
Get the current formatted date/time string.
Get the current datetime described by specified format.
void RTC::basic_medlogbuf< _CharT, _Traits >::setSuffix | ( | char * | suffix | ) | [inline] |
Set suffix of date/time string of header.
Set the suffix string added after the datatime of the header.
suffix | Suffix string |
void RTC::basic_medlogbuf< _CharT, _Traits >::setSuffix | ( | const std::string & | suffix | ) | [inline] |
Set suffix of date/time string of header.
Set the suffix string added after the datatime of the header.
suffix | Suffix string |
std::string RTC::basic_medlogbuf< _CharT, _Traits >::getSuffix | ( | ) | [inline] |
Get suffix of date/time string of header.
Get the suffix string added after the datatime of the header.
virtual int RTC::basic_medlogbuf< _CharT, _Traits >::sync | ( | ) | [inline, protected, virtual] |
synchronization of buffer
Synchronous function to be invoked when the buffer was flushed.