97#ifdef GDCM_CXX_HAS_FUNCTION
101# define __FUNCTION__ __FUNC__
104# define GDCM_FUNCTION __PRETTY_FUNCTION__
106# define GDCM_FUNCTION __FUNCTION__
109# define GDCM_FUNCTION "<unknown>"
116#if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
117#define gdcmDebugMacro(msg) GDCM_NOOP_STATEMENT
119#define gdcmDebugMacro(msg) \
121 if( gdcm::Trace::GetDebugFlag() ) \
123 std::ostringstream osmacro; \
124 osmacro << "Debug: In " __FILE__ ", line " << __LINE__ \
125 << ", function " << GDCM_FUNCTION << '\n' \
126 << "Last system error was: " \
127 << gdcm::System::GetLastSystemError() << '\n' << msg; \
128 std::ostream &_os = gdcm::Trace::GetDebugStream(); \
129 _os << osmacro.str() << "\n\n" << std::endl; \
139#if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
140#define gdcmWarningMacro(msg) GDCM_NOOP_STATEMENT
142#define gdcmWarningMacro(msg) \
144 if( gdcm::Trace::GetWarningFlag() ) \
146 std::ostringstream osmacro; \
147 osmacro << "Warning: In " __FILE__ ", line " << __LINE__ \
148 << ", function " << GDCM_FUNCTION << "\n" \
150 std::ostream &_os = gdcm::Trace::GetWarningStream(); \
151 _os << osmacro.str() << std::endl; \
162#if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
163#define gdcmErrorMacro(msg) GDCM_NOOP_STATEMENT
165#define gdcmErrorMacro(msg) \
167 if( gdcm::Trace::GetErrorFlag() ) \
169 std::ostringstream osmacro; \
170 osmacro << "Error: In " __FILE__ ", line " << __LINE__ \
171 << ", function " << GDCM_FUNCTION << '\n' \
173 std::ostream &_os = gdcm::Trace::GetErrorStream(); \
174 _os << osmacro.str() << std::endl; \
186#if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
187#define gdcmAssertMacro(arg) GDCM_NOOP_STATEMENT
189#define gdcmAssertMacro(arg) \
193 std::ostringstream osmacro; \
194 osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
195 << ", function " << GDCM_FUNCTION \
197 std::ostream &_os = gdcm::Trace::GetErrorStream(); \
198 _os << osmacro.str() << std::endl; \
214#define gdcmAssertAlwaysMacro(arg) \
218 std::ostringstream osmacro; \
219 osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
220 << ", function " << GDCM_FUNCTION \
222 throw osmacro.str(); \
228#define gdcmAssertAlwaysMacro(arg) gdcmAssertMacro(arg)
Trace.
Definition gdcmTrace.h:42
static void SetError(bool debug)
Turn error messages on (default: true)
static void SetDebug(bool debug)
Turn debug messages on (default: false)
static void SetDebugStream(std::ostream &os)
Explicitly set the stream which receive Debug messages:
static std::ostream & GetErrorStream()
static void SetStreamToFile(const char *filename)
static void SetWarningStream(std::ostream &os)
Explicitly set the stream which receive Warning messages:
static void SetWarning(bool debug)
Turn warning messages on (default: true)
static std::ostream & GetDebugStream()
static std::ostream & GetStream()
static void SetStream(std::ostream &os)
static bool GetDebugFlag()
static void SetErrorStream(std::ostream &os)
Explicitly set the stream which receive Error messages:
static bool GetWarningFlag()
static std::ostream & GetWarningStream()
static bool GetErrorFlag()
#define GDCM_EXPORT
Definition gdcmWin32.h:34