Changeset 1215


Ignore:
Timestamp:
04/17/23 00:04:28 (12 months ago)
Author:
Maciej Komosinski
Message:

Less ambiguous names of counting functions in loggers: warning -> error_warning, info -> error_warning_info

Location:
cpp
Files:
4 edited

Legend:

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

    r1075 r1215  
    156156string LoggerToMemory::getCountSummary() const
    157157{
    158         if (getInfoCount())
     158        if (getErrorWarningInfoCount())
    159159        {
    160160                string msg;
     
    162162                        msg = ssprintf("%d error(s)", getErrorCount());
    163163                int w;
    164                 if ((w = getWarningCount() - getErrorCount()))
    165                         msg += ssprintf("%s%d warning(s)", (getErrorCount() ? ", " : ""), w);
    166                 if ((w = getInfoCount() - getWarningCount()))
    167                         msg += ssprintf("%s%d message(s)", (getWarningCount() ? ", " : ""), w);
     164                if ((w = getWarningCount()))
     165                        msg += ssprintf("%s%d warning(s)", (msg.size()>0 ? ", " : ""), w);
     166                if ((w = getInfoCount()))
     167                        msg += ssprintf("%s%d message(s)", (msg.size()>0 ? ", " : ""), w);
    168168                return msg;
    169169        }
  • cpp/common/loggers/loggers.h

    r1130 r1215  
    9595
    9696        int getErrorCount() const   { return errcount; }
    97         int getWarningCount() const { return warncount; }
    98         int getInfoCount() const    { return infocount; }
     97        int getErrorWarningCount() const   { return warncount; } //previously: getWarningCount()
     98        int getErrorWarningInfoCount() const   { return infocount; } //previously: getInfoCount()
     99        int getWarningCount() const { return warncount-errcount; }
     100        int getInfoCount() const    { return infocount-warncount; }
    99101        int getStoredCount() const  { return storedcount; }
    100102        int getErrorLevel() const   { return maxlevel; }
  • cpp/frams/genetics/fH/fH_oper.cpp

    r1167 r1215  
    7171        int amount = builder.removeNeuronsWithInvalidClasses();
    7272        // if there were any warnings, then rewrite genotype
    73         if (eh.getWarningCount() > 0 || amount > 0)
     73        if (eh.getErrorWarningCount() > 0 || amount > 0)
    7474        {
    7575                free(geno);
  • cpp/frams/model/model.cpp

    r1135 r1215  
    406406                        return;
    407407                }
    408                 if (mh.getWarningCount())
     408                if (mh.getErrorWarningCount())
    409409                {
    410410                        if (f0warnposition < 0) f0warnposition = lastpos;
Note: See TracChangeset for help on using the changeset viewer.