+/**
+ * \brief Verbose
+ * @param msg message part
+ */
+#ifdef NDEBUG
+#define gdcmVerboseMacro(msg)
+#else
+#define gdcmVerboseMacro(msg) \
+{ \
+ if( Debug::GetDebugFlag() ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Verbose: In " __FILE__ ", line " << __LINE__ \
+ << ", function " << GDCM_FUNCTION << "\n" \
+ << msg << "\n\n"; \
+ if( Debug::GetDebugToFile() ) \
+ Debug::GetDebugFile() << osmacro.str() << std::endl; \
+ else \
+ std::cerr << osmacro.str() << std::endl; \
+ } \
+}
+#endif //NDEBUG
+
+/**
+ * \brief Error
+ * @param msg second message part
+ */
+#ifdef NDEBUG
+#define gdcmErrorMacro(msg)
+#else
+#define gdcmErrorMacro(msg) \
+{ \
+ if( Debug::GetDebugFlag() ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Error: In " __FILE__ ", line " << __LINE__ \
+ << ", function " << GDCM_FUNCTION << '\n' \
+ << msg << "\n\n"; \
+ if( Debug::GetDebugToFile() ) \
+ Debug::GetDebugFile() << osmacro.str() << std::endl; \
+ else \
+ std::cerr << osmacro.str() << std::endl; \
+ exit(1); \
+ } \
+}
+#endif //NDEBUG
+
+/**
+ * \brief Assert
+ * @param arg argument to test
+ * An easy solution to pass also a message is to do:
+ * gdcmAssertMacro( "my message" && 2 < 3 )
+ */
+#ifdef NDEBUG
+#define gdcmAssertMacro(arg)
+#else
+#define gdcmAssertMacro(arg) \
+{ \
+ if( !(arg) ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
+ << ", function " << GDCM_FUNCTION \
+ << "\n\n"; \
+ if( Debug::GetDebugToFile() ) \
+ Debug::GetDebugFile() << osmacro.str() << std::endl; \
+ else \
+ std::cerr << osmacro.str() << std::endl; \
+ assert ( arg ); \
+ } \
+}
+#endif //NDEBUG