Changeset 522 for cpp/common
- Timestamp:
- 06/23/16 00:15:59 (9 years ago)
- Location:
- cpp/common/loggers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/loggers/loggers.cpp
r511 r522 155 155 string LoggerToMemory::getCountSummary() const 156 156 { 157 if (getInfoCount())157 if (getInfoCount()) 158 158 { 159 string msg;160 if (getErrorCount())161 msg=ssprintf("%d error(s)",getErrorCount());162 int w;163 if (w=getWarningCount()-getErrorCount())164 msg+=ssprintf("%s%d warning(s)",(getErrorCount()?", ":""),w);165 if (w=getInfoCount()-getWarningCount())166 msg+=ssprintf("%s%d message(s)",(getWarningCount()?", ":""),w);167 return msg;159 string msg; 160 if (getErrorCount()) 161 msg = ssprintf("%d error(s)", getErrorCount()); 162 int w; 163 if (w = getWarningCount() - getErrorCount()) 164 msg += ssprintf("%s%d warning(s)", (getErrorCount() ? ", " : ""), w); 165 if (w = getInfoCount() - getWarningCount()) 166 msg += ssprintf("%s%d message(s)", (getWarningCount() ? ", " : ""), w); 167 return msg; 168 168 } 169 return string("");169 return string(""); 170 170 } 171 171 -
cpp/common/loggers/loggertostdout.cpp
r511 r522 12 12 13 13 static const char* default_log_level_ansicolor[] = 14 14 { "[\033[2mDEBUG\033[0m] \033[2m", "", "[\033[33mWARN\033[0m] \033[1m", "[\033[1;31mERROR\033[0m] \033[1m", "[\033[1;31mCRITICAL\033[0m] \033[1m" }; 15 15 16 16 const char** LoggerToStdout::default_log_level[] = 17 17 { LOG_LEVEL, default_log_level_ansicolor }; 18 18 19 const char* LoggerToStdout::default_log_format[] = //note trailing %s (so it's easy to append "\n" later)20 19 const char* LoggerToStdout::default_log_format[] = //note trailing %s (so it's easy to append "\n" later) 20 { LOG_FORMAT "%s", "%s%s.%s: %s\033[0m%s" }; 21 21 22 22 LoggerToStdout::LoggerToStdout(int opts, VirtFILE *_file) 23 23 :LoggerBase(opts), file(_file) 24 24 { 25 log_format=default_log_format[console_color_mode];26 log_level=default_log_level[console_color_mode];25 log_format = default_log_format[console_color_mode]; 26 log_level = default_log_level[console_color_mode]; 27 27 } 28 28
Note: See TracChangeset
for help on using the changeset viewer.