Changeset 875 for cpp/common/log.cpp


Ignore:
Timestamp:
05/06/19 13:14:56 (2 weeks ago)
Author:
Maciej Komosinski
Message:

Better use of LOG_level constants

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/log.cpp

    r874 r875  
    77#include "util-string.h"
    88#include "Convert.h"
     9#include <assert.h>
    910
    1011const char* LOG_LEVEL_ARRAY[] = { "[DEBUG] ", "", "[WARN] ", "[ERROR] ", "[CRITICAL] " };
     
    3435const char* logLevelName(int level)
    3536{
    36         level = min(LOG_CRITICAL, max(LOG_DEBUG, level));
     37        assert((level>=LOG_MIN) && (level<=LOG_MAX));
     38        level = min(LOG_MAX, max(LOG_MIN, level));
    3739        return LOG_LEVEL_ARRAY[level + 1];
    3840}
Note: See TracChangeset for help on using the changeset viewer.