Changeset 522 for cpp/common


Ignore:
Timestamp:
06/23/16 00:15:59 (9 years ago)
Author:
Maciej Komosinski
Message:

Code formatting

Location:
cpp/common/loggers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/loggers/loggers.cpp

    r511 r522  
    155155string LoggerToMemory::getCountSummary() const
    156156{
    157 if (getInfoCount())
     157        if (getInfoCount())
    158158        {
    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;
    168168        }
    169 return string("");
     169        return string("");
    170170}
    171171
  • cpp/common/loggers/loggertostdout.cpp

    r511 r522  
    1212
    1313static const char* default_log_level_ansicolor[] =
    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" };
     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" };
    1515
    1616const char** LoggerToStdout::default_log_level[] =
    17  { LOG_LEVEL, default_log_level_ansicolor };
     17{ LOG_LEVEL, default_log_level_ansicolor };
    1818
    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" };
     19const 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" };
    2121
    2222LoggerToStdout::LoggerToStdout(int opts, VirtFILE *_file)
    2323        :LoggerBase(opts), file(_file)
    2424{
    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];
    2727}
    2828
Note: See TracChangeset for help on using the changeset viewer.