Changeset 875 for cpp/common
- Timestamp:
- 05/06/19 13:14:56 (6 years ago)
- Location:
- cpp/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/log.cpp
r874 r875 7 7 #include "util-string.h" 8 8 #include "Convert.h" 9 #include <assert.h> 9 10 10 11 const char* LOG_LEVEL_ARRAY[] = { "[DEBUG] ", "", "[WARN] ", "[ERROR] ", "[CRITICAL] " }; … … 34 35 const char* logLevelName(int level) 35 36 { 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)); 37 39 return LOG_LEVEL_ARRAY[level + 1]; 38 40 } -
cpp/common/log.h
r874 r875 20 20 21 21 //level (importance) of a message 22 #define LOG_MIN LOG_DEBUG 22 23 #define LOG_DEBUG -1 //debugging information, not needed for final users 23 24 #define LOG_INFO 0 //information … … 25 26 #define LOG_ERROR 2 //uncorrected error, can cause malfunction 26 27 #define LOG_CRITICAL 3 //serious error, causes side effects. User should save what can be saved and restart the application 28 #define LOG_MAX LOG_CRITICAL 27 29 28 30 #endif -
cpp/common/loggers/loggertostdout.cpp
r874 r875 5 5 #include "loggertostdout.h" 6 6 #include <common/console.h> 7 #include <assert.h> 7 8 #ifdef SHP 8 9 #include <FBaseSys.h> //AppLog … … 36 37 else 37 38 { 38 if (level < -1) level = -1; else if (level > 3) level = 3; 39 assert((level>=LOG_MIN) && (level<=LOG_MAX)); 40 level = min(LOG_MAX, max(LOG_MIN, level)); 39 41 printf(log_format, log_level[level + 1], obj, method, msg, "\n"); 40 42 }
Note: See TracChangeset
for help on using the changeset viewer.