19 #ifndef RTC_SYSTEMLOGGER_H 20 #define RTC_SYSTEMLOGGER_H 22 #include <rtm/config_rtc.h> 25 #include <coil/Time.h> 26 #include <coil/Logger.h> 27 #include <coil/Mutex.h> 28 #include <coil/Guard.h> 29 #include <coil/stringutil.h> 134 Logger(
const char* name =
"");
153 Logger(LogStreamBuf* streambuf);
280 void setName(
const char* name);
364 #define RTC_LOG(LV, fmt) \ 365 if (rtclog.isValid(LV)) \ 367 std::string str = ::coil::sprintf fmt; \ 369 rtclog.level(LV) << str << std::endl; \ 373 #define RTC_LOG_STR(LV, str) \ 374 if (rtclog.isValid(LV)) \ 377 rtclog.level(LV) << str << std::endl; \ 400 #define RTC_FATAL(fmt) RTC_LOG(::RTC::Logger::RTL_FATAL, fmt) 401 #define RTC_FATAL_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_FATAL, str) 422 #define RTC_ERROR(fmt) RTC_LOG(::RTC::Logger::RTL_ERROR, fmt) 423 #define RTC_ERROR_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_ERROR, str) 444 #define RTC_WARN(fmt) RTC_LOG(::RTC::Logger::RTL_WARN, fmt) 445 #define RTC_WARN_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_WARN, str) 466 #define RTC_INFO(fmt) RTC_LOG(::RTC::Logger::RTL_INFO, fmt) 467 #define RTC_INFO_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_INFO, str) 488 #define RTC_DEBUG(fmt) RTC_LOG(::RTC::Logger::RTL_DEBUG, fmt) 489 #define RTC_DEBUG_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_DEBUG, str) 510 #define RTC_TRACE(fmt) RTC_LOG(::RTC::Logger::RTL_TRACE, fmt) 511 #define RTC_TRACE_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_TRACE, str) 533 #define RTC_VERBOSE(fmt) RTC_LOG(::RTC::Logger::RTL_VERBOSE, fmt) 534 #define RTC_VERBOSE_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_VERBOSE, str) 555 #define RTC_PARANOID(fmt) RTC_LOG(::RTC::Logger::RTL_PARANOID, fmt) 556 #define RTC_PARANOID_STR(str) RTC_LOG_STR(::RTC::Logger::RTL_PARANOID, str) 559 #define RTC_ERROR(fmt) 560 #define RTC_ERROR_STR(str) 561 #define RTC_WARN(fmt) 562 #define RTC_WARN_STR(str) 563 #define RTC_NORMAL(fmt) 564 #define RTC_NORMAL_STR(str) 565 #define RTC_INFO(fmt) 566 #define RTC_INFO_STR(str) 567 #define RTC_DEBUG(fmt) 568 #define RTC_DEBUG_STR(str) 569 #define RTC_TRACE(fmt) 570 #define RTC_TRACE_STR(str) 571 #define RTC_VERBOSE(fmt) 572 #define RTC_VERBOSE_STR(str) 573 #define RTC_PARANOID(fmt) 574 #define RTC_PARANOID_STR(str) 579 #endif // RTC_SYSTEMLOGGER_H void setDateFormat(const char *format)
Set date/time format for adding the header.
virtual ~Logger(void)
Virtual destructor.
virtual void header(int level)
Message prefix appender function.
::coil::LogStreamBuffer LogStreamBuf
::coil::LogStream LogStream
void setName(const char *name)
Set suffix of date/time string of header.
log_stream template class
log_streambuf< char > LogStreamBuffer
bool setLevel(const char *level)
Set log level by string.
ostream_type & level(int level)
Acquire log stream.
Logger(const char *name="")
Constructor.
int strToLevel(const char *level)
Set the log level Set the log level corresponding to the given string.
static const char * m_levelString[]
std::string getDate(void)
Get the current formatted date/time string Get the current datetime described by specified format...