16 #include <pz_config.h> 21 std::cout <<
"Ponto de parada\n";
31 #include <log4cxx/logger.h> 32 #include <log4cxx/basicconfigurator.h> 33 #include <log4cxx/propertyconfigurator.h> 34 using namespace log4cxx;
35 using namespace log4cxx::helpers;
42 extern pthread_mutex_t glogmutex;
53 #define LOGPZ_DEBUG(A,B) { \ 54 if(A->isDebugEnabled()) { \ 55 PZ_PTHREAD_MUTEX_LOCK(&glogmutex,"LOGPZ_DEBUG"); \ 57 PZ_PTHREAD_MUTEX_UNLOCK(&glogmutex,"LOGPZ_DEBUG"); } \ 58 else std::cout << "Coloque IsDebugEnabled em " << __FILE__ << ":" << __LINE__ << std::endl;} 61 #define LOGPZ_INFO(A,B) {if(A->isInfoEnabled()) { \ 62 PZ_PTHREAD_MUTEX_LOCK(&glogmutex, "LOGPZ_INFO"); \ 64 PZ_PTHREAD_MUTEX_UNLOCK(&glogmutex, "LOGPZ_INFO"); } } 67 #define LOGPZ_WARN(A,B) {if(A->isWarnEnabled()) { \ 68 PZ_PTHREAD_MUTEX_LOCK(&glogmutex,"LOGPZ_WARN"); \ 70 PZ_PTHREAD_MUTEX_UNLOCK(&glogmutex,"LOGPZ_WARN"); } } 73 #define LOGPZ_ERROR(A,B) {if(A->isErrorEnabled()) { \ 74 PZ_PTHREAD_MUTEX_LOCK(&glogmutex,"LOGPZ_ERROR"); \ 75 LOG4CXX_ERROR(A,B); StopError(); \ 76 PZ_PTHREAD_MUTEX_UNLOCK(&glogmutex,"LOGPZ_ERROR"); } } 79 #define LOGPZ_FATAL(A,B) {if(A->isFatalEnabled()) { \ 80 PZ_PTHREAD_MUTEX_LOCK(&glogmutex,"LOGPZ_FATAL"); \ 82 PZ_PTHREAD_MUTEX_LOCK(&glogmutex,"LOGPZ_FATAL"); } } 87 #define LOGPZ_DEBUG(A,B) {} 88 #define LOGPZ_INFO(A,B) {} 90 #define LOGPZ_WARN(A,B) {} 92 #define LOGPZ_ERROR(A,B) {std::cout << B << std::endl;} 94 #define LOGPZ_FATAL(A,B) {std::cout << B << std::endl;} 109 log4cxx::PropertyConfigurator::configure(configfile);
111 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(
"pz.mesh.tpzgeoelrefpattern"));
112 logger->setAdditivity(
false);
116 log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(
"pz.mesh.refpattern"));
117 logger->setAdditivity(
false);
#define DebugStop()
Returns a message to user put a breakpoint in.
void InitializePZLOG(const std::string &configfile)
Initialize a log file adequated to use log4cxx lib.