Changeset 2467 for source/ariba/utility/logging
- Timestamp:
- Feb 19, 2009, 4:45:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/logging/Logging.h
r2455 r2467 45 45 #include <log4cxx/basicconfigurator.h> 46 46 47 #define colorDefault { std::cout << "\033[0m"; } /*reset*/ 48 #define colorDebug { std::cout << "\033[31m"; } /*gray*/ 49 #define colorInfo { std::cout << "\033[32m"; } /*green*/ 50 #define colorWarn { std::cout << "\033[34m"; } /*blue*/ 51 #define colorError { std::cout << "\033[31m"; } /*red*/ 47 #ifdef LOGCOLORS 48 49 #define colorDefault { std::cout << "\033[0m"; } /*reset*/ 50 #define colorDebug { std::cout << "\033[33m"; } /*cyan*/ 51 #define colorInfo { std::cout << "\033[32m"; } /*green*/ 52 #define colorWarn { std::cout << "\033[34m"; } /*blue*/ 53 #define colorError { std::cout << "\033[31m"; } /*red*/ 54 55 #else 56 57 #define colorDefault { } 58 #define colorDebug { } 59 #define colorInfo { } 60 #define colorWarn { } 61 #define colorError { } 62 63 #endif // ENABLE_LOGCOLORS 52 64 53 65 #define use_logging_h(x) \ … … 57 69 log4cxx::LoggerPtr x::logger(log4cxx::Logger::getLogger(#x)); 58 70 59 #define logging_trace(x) { LOG4CXX_TRACE(logger,x); }60 #define logging_debug(x) {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault; }61 #define logging_info(x) {colorInfo; LOG4CXX_INFO(logger,x); colorDefault; }62 #define logging_warn(x) {colorWarn; LOG4CXX_WARN(logger,x); colorDefault; }63 #define logging_error(x) {colorError; LOG4CXX_ERROR(logger,x); colorDefault; }64 #define logging_fatal(x) {colorError; LOG4CXX_FATAL(logger,x); exit(-1);}71 #define logging_trace(x) { LOG4CXX_TRACE(logger,x); } 72 #define logging_debug(x) {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault; } 73 #define logging_info(x) {colorInfo; LOG4CXX_INFO(logger,x); colorDefault; } 74 #define logging_warn(x) {colorWarn; LOG4CXX_WARN(logger,x); colorDefault; } 75 #define logging_error(x) {colorError; LOG4CXX_ERROR(logger,x); colorDefault; } 76 #define logging_fatal(x) {colorError; LOG4CXX_FATAL(logger,x); colorDefault; exit(-1); } 65 77 66 78 #endif //LOGGING_H__
Note:
See TracChangeset
for help on using the changeset viewer.