26 #if defined(_ICU_) && !defined(_ICUSWORD_)
28 #include <unicode/ustdio.h>
29 #include <unicode/ustream.h>
36 using namespace std::chrono;
54 static class __staticSystemLog {
57 __staticSystemLog(
SWLog **clear) { this->clear = clear; }
58 ~__staticSystemLog() {
delete *clear; *clear = 0; }
62 systemLog =
new SWLog();
69 delete getSystemLog();
77 if (logLevel >= LOG_WARN) {
79 va_start(argptr, fmt);
82 logMessage(msg, LOG_WARN);
92 va_start(argptr, fmt);
95 logMessage(msg, LOG_ERROR);
103 if (logLevel >= LOG_INFO) {
105 va_start(argptr, fmt);
108 logMessage(msg, LOG_INFO);
116 if (logLevel >= LOG_TIMEDINFO) {
117 const char *fmtStr = fmt;
122 fmtStr = msgTS.
c_str();
124 va_start(argptr, fmt);
127 logMessage(msg, LOG_TIMEDINFO);
135 if (logLevel >= LOG_DEBUG) {
137 va_start(argptr, fmt);
140 logMessage(msg, LOG_DEBUG);
145 std::cerr << message;
146 std::cerr << std::endl;
virtual void logTimedInformation(const char *fmt,...) const
#define SWORD_NAMESPACE_START
virtual void logMessage(const char *message, int level) const
SWBuf & setFormattedVA(const char *format, va_list argptr)
static SWLog * getSystemLog()
static void setSystemLog(SWLog *newLogger)
const char * c_str() const
static const char LOG_WARN
void logInformation(const char *fmt,...) const
void logWarning(const char *fmt,...) const
void logError(const char *fmt,...) const
void logDebug(const char *fmt,...) const
static const char LOG_INFO
#define SWORD_NAMESPACE_END
SWBuf & setFormatted(const char *format,...)
static const char LOG_ERROR
static const char LOG_TIMEDINFO
static const char LOG_DEBUG