Public Member Functions | |
std::string | getDate (void) |
Get the current formatted date/time string Get the current datetime described by specified format. | |
void | header (int level) |
Message prefix appender function. | |
LoggerMock (RTC::LogStreamBuf *streambuf) | |
void | setDateFormat (const char *format) |
Set date/time format for adding the header. | |
void | setName (const char *name) |
Set suffix of date/time string of header. | |
int | strToLevel (const char *level) |
Set the log level Set the log level corresponding to the given string. | |
std::string | test_string (void) |
virtual | ~LoggerMock (void) |
Public Attributes | |
std::string | mock_m_dateFormat |
std::string | mock_m_name |
Definition at line 46 of file SystemLoggerTests.cpp.
Tests::LoggerMock::LoggerMock | ( | RTC::LogStreamBuf * | streambuf | ) | [inline] |
Definition at line 50 of file SystemLoggerTests.cpp.
virtual Tests::LoggerMock::~LoggerMock | ( | void | ) | [inline, virtual] |
Definition at line 52 of file SystemLoggerTests.cpp.
std::string Tests::LoggerMock::getDate | ( | void | ) | [inline] |
Get the current formatted date/time string Get the current datetime described by specified format.
Get the current formatted date/time string.
Reimplemented from RTC::Logger.
Definition at line 78 of file SystemLoggerTests.cpp.
void Tests::LoggerMock::header | ( | int | level | ) | [inline, virtual] |
Message prefix appender function.
Subclasses of this class should override this operation, and this function should be defined to append some prefix to the log messages.
Reimplemented from RTC::Logger.
Definition at line 71 of file SystemLoggerTests.cpp.
void Tests::LoggerMock::setDateFormat | ( | const char * | format | ) | [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 %Q millisecond as a number (0-999) from ver 1.1 %q microsecond as a number (0-999) from ver 1.1 %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 |
Reimplemented from RTC::Logger.
Definition at line 55 of file SystemLoggerTests.cpp.
void Tests::LoggerMock::setName | ( | const char * | name | ) | [inline] |
Set suffix of date/time string of header.
Set the suffix string added after the datatime of the header.
suffix | Suffix string |
Reimplemented from RTC::Logger.
Definition at line 63 of file SystemLoggerTests.cpp.
int Tests::LoggerMock::strToLevel | ( | const char * | level | ) | [inline] |
Set the log level Set the log level corresponding to the given string.
Set the log level.
lv | Log level string |
Reimplemented from RTC::Logger.
Definition at line 84 of file SystemLoggerTests.cpp.
std::string Tests::LoggerMock::test_string | ( | void | ) | [inline] |
Definition at line 91 of file SystemLoggerTests.cpp.
std::string Tests::LoggerMock::mock_m_dateFormat |
Definition at line 102 of file SystemLoggerTests.cpp.
std::string Tests::LoggerMock::mock_m_name |
Definition at line 101 of file SystemLoggerTests.cpp.