Changeset 7727 for source/ariba/utility/logging/Logging.h
- Timestamp:
- Mar 9, 2010, 1:23:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/logging/Logging.h
r6832 r7727 42 42 #include <iostream> 43 43 #include <cstdlib> 44 45 #ifdef HAVE_LOG4CXX_LOGGER_H 44 46 #include <log4cxx/logger.h> 45 47 #include <log4cxx/basicconfigurator.h> 46 48 #endif // HAVE_LOG4CXX_LOGGER_H 47 49 48 50 #ifdef LOGCOLORS … … 64 66 #endif // ENABLE_LOGCOLORS 65 67 66 #define use_logging_h(x) \67 private: static log4cxx::LoggerPtr logger;68 68 69 #define use_logging_cpp(x) \ 69 #ifdef HAVE_LOG4CXX_LOGGER_H 70 71 #define use_logging_h(x) \ 72 private: static log4cxx::LoggerPtr logger; 73 74 #define use_logging_cpp(x) \ 70 75 log4cxx::LoggerPtr x::logger(log4cxx::Logger::getLogger(#x)); 71 76 72 #define logging_trace(x) { LOG4CXX_TRACE(logger,x); } 73 #define logging_debug(x) {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault; } 74 #define logging_info(x) {colorInfo; LOG4CXX_INFO(logger,x); colorDefault; } 75 #define logging_warn(x) {colorWarn; LOG4CXX_WARN(logger,x); colorDefault; } 76 #define logging_error(x) {colorError; LOG4CXX_ERROR(logger,x); colorDefault; } 77 #define logging_fatal(x) {colorError; LOG4CXX_FATAL(logger,x); colorDefault; exit(-1); } 77 #define logging_trace(x) { LOG4CXX_TRACE(logger,x); } 78 #define logging_debug(x) {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault; } 79 #define logging_info(x) {colorInfo; LOG4CXX_INFO(logger,x); colorDefault; } 80 #define logging_warn(x) {colorWarn; LOG4CXX_WARN(logger,x); colorDefault; } 81 #define logging_error(x) {colorError; LOG4CXX_ERROR(logger,x); colorDefault; } 82 #define logging_fatal(x) {colorError; LOG4CXX_FATAL(logger,x); colorDefault; exit(-1); } 83 84 #else // HAVE_LOG4CXX_LOGGER_H 85 86 #define use_logging_h(x) 87 88 #define use_logging_cpp(x) 89 90 #define logging_stdout(x) std::cout << x << std::endl; 91 92 #define logging_trace(x) 93 #define logging_debug(x) {colorDebug; logging_stdout(x); colorDefault; } 94 #define logging_info(x) {colorInfo; logging_stdout(x); colorDefault; } 95 #define logging_warn(x) {colorWarn; logging_stdout(x); colorDefault; } 96 #define logging_error(x) {colorError; logging_stdout(x); colorDefault; } 97 #define logging_fatal(x) {colorError; logging_stdout(x); colorDefault; exit(-1); } 98 99 #endif // HAVE_LOG4CXX_LOGGER_H 78 100 79 101 #endif //LOGGING_H__
Note:
See TracChangeset
for help on using the changeset viewer.