Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef __POINTMATCHER_PRIVATE_H
00037 #define __POINTMATCHER_PRIVATE_H
00038
00039 namespace PointMatcherSupport
00040 {
00042 extern boost::mutex loggerMutex;
00044 extern std::shared_ptr<Logger> logger;
00045
00046
00047 #if defined(MSVC)
00048 #define __POINTMATCHER_FUNCTION__ __FUNCSIG__
00049 #elif defined(__GNUC__)
00050 #define __POINTMATCHER_FUNCTION__ __PRETTY_FUNCTION__
00051 #else
00052 #define __POINTMATCHER_FUNCTION__ ""
00053 #endif
00054
00055
00056 #define LOG_INFO_STREAM(args) \
00057 { \
00058 boost::mutex::scoped_lock lock(PointMatcherSupport::loggerMutex); \
00059 if (PointMatcherSupport::logger.get() && \
00060 PointMatcherSupport::logger->hasInfoChannel()) { \
00061 PointMatcherSupport::logger->beginInfoEntry(__FILE__, __LINE__, __POINTMATCHER_FUNCTION__); \
00062 (*PointMatcherSupport::logger->infoStream()) << args; \
00063 PointMatcherSupport::logger->finishInfoEntry(__FILE__, __LINE__, __POINTMATCHER_FUNCTION__); \
00064 } \
00065 }
00066 #define LOG_WARNING_STREAM(args) \
00067 { \
00068 boost::mutex::scoped_lock lock(PointMatcherSupport::loggerMutex); \
00069 if (PointMatcherSupport::logger.get() && \
00070 PointMatcherSupport::logger->hasWarningChannel()) { \
00071 PointMatcherSupport::logger->beginWarningEntry(__FILE__, __LINE__, __POINTMATCHER_FUNCTION__); \
00072 (*PointMatcherSupport::logger->warningStream()) << args; \
00073 PointMatcherSupport::logger->finishWarningEntry(__FILE__, __LINE__, __POINTMATCHER_FUNCTION__); \
00074 } \
00075 }
00076 };
00077
00078 #endif // __POINTMATCHER_PRIVATE_H