244 enum Type{kTypeNoLog, kTypeConsole, kTypeFile};
252 enum Level{kDebug, kInfo, kWarning, kError, kFatal};
265 static void setType(
Type type,
const std::string &fileName = kDefaultLogFileName,
bool append =
true);
266 static Type type() {
return type_;}
274 static bool isPrintTime() {
return printTime_;}
281 static bool isPrintLevel() {
return printLevel_;}
288 static bool isPrintEndLine() {
return printEndline_;}
296 static bool isPrintColored() {
return printColored_;}
303 static bool isPrintWhere() {
return printWhere_;}
310 static bool isPrintThreadId() {
return printThreadID_;}
317 static bool isPrintWhereFullPath() {
return printWhereFullPath_;}
330 static bool isBuffered() {
return buffered_;}
359 static void setTreadIdFilter(
const std::vector<std::string> & ids);
360 static const std::set<unsigned long> & getTreadIdFilter() {
return threadIdFilter_;}
367 static void unregisterCurrentThread();
368 static std::map<std::string, unsigned long> getRegisteredThreads();
393 const char *function,
396#if defined(__GNUC__) || defined(__clang__)
405 __attribute__((format(printf, 5, 6)))
459 static std::string logFileName_;
473 static ULogger* createInstance();
483 virtual void _write(
const char*, va_list) {}
484 virtual void _writeStr(
const char*) {}
501 static bool printTime_;
507 static bool printLevel_;
513 static bool printEndline_;
519 static bool printColored_;
525 static bool printWhere_;
533 static bool printWhereFullPath_;
539 static bool printThreadID_;
547 static bool limitWhereLength_;
562 static Level eventLevel_;
564 static const char * levelName_[5];
569 static UMutex loggerMutex_;
575 static bool buffered_;
577 static std::string bufferedMsgs_;
579 static std::set<unsigned long> threadIdFilter_;
580 static std::map<std::string, unsigned long> registeredThreads_;