49 static void SetStream(std::ostream &os);
50 static std::ostream &GetStream();
53 static void SetDebugStream(std::ostream &os);
54 static std::ostream &GetDebugStream();
57 static void SetWarningStream(std::ostream &os);
58 static std::ostream &GetWarningStream();
61 static void SetErrorStream(std::ostream &os);
62 static std::ostream &GetErrorStream();
66 static void SetStreamToFile(
const char *filename );
69 static void SetDebug(
bool debug);
70 static void DebugOn();
71 static void DebugOff();
72 static bool GetDebugFlag();
75 static void SetWarning(
bool debug);
76 static void WarningOn();
77 static void WarningOff();
78 static bool GetWarningFlag();
81 static void SetError(
bool debug);
82 static void ErrorOn();
83 static void ErrorOff();
84 static bool GetErrorFlag();
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 "<unknow>"
110 #endif //GDCM_CXX_HAS_FUNCTION
116 #if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
117 #define gdcmDebugMacro(msg) {}
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; \
138 #if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
139 #define gdcmWarningMacro(msg) {}
141 #define gdcmWarningMacro(msg) \
143 if( gdcm::Trace::GetWarningFlag() ) \
145 std::ostringstream osmacro; \
146 osmacro << "Warning: In " __FILE__ ", line " << __LINE__ \
147 << ", function " << GDCM_FUNCTION << "\n" \
149 std::ostream &_os = gdcm::Trace::GetWarningStream(); \
150 _os << osmacro.str() << std::endl; \
160 #if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
161 #define gdcmErrorMacro(msg) {}
163 #define gdcmErrorMacro(msg) \
165 if( gdcm::Trace::GetErrorFlag() ) \
167 std::ostringstream osmacro; \
168 osmacro << "Error: In " __FILE__ ", line " << __LINE__ \
169 << ", function " << GDCM_FUNCTION << '\n' \
171 std::ostream &_os = gdcm::Trace::GetErrorStream(); \
172 _os << osmacro.str() << std::endl; \
183 #if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
184 #define gdcmAssertMacro(arg) {}
186 #define gdcmAssertMacro(arg) \
190 std::ostringstream osmacro; \
191 osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
192 << ", function " << GDCM_FUNCTION \
194 std::ostream &_os = gdcm::Trace::GetErrorStream(); \
195 _os << osmacro.str() << std::endl; \
207 #if defined(NDEBUG) && !defined(GDCM_ALWAYS_TRACE_MACRO)
210 #define gdcmAssertAlwaysMacro(arg) \
214 std::ostringstream osmacro; \
215 osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
216 << ", function " << GDCM_FUNCTION \
218 throw osmacro.str(); \
223 #define gdcmAssertAlwaysMacro(arg) gdcmAssertMacro(arg)
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
Trace.
Definition: gdcmTrace.h:41
Definition: gdcmASN1.h:20