1 /*=========================================================================
4 Module: $RCSfile: gdcmDebug.cxx,v $
6 Date: $Date: 2005/01/07 16:26:12 $
7 Version: $Revision: 1.14 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
20 #include "gdcmDebug.h"
25 /// warning message level to be displayed
26 static int DebugLevel = -1;
27 //-----------------------------------------------------------------------------
30 * @param level Set the debug level
32 void Debug::SetDebugLevel (int level)
40 * @param msg1 first message part
41 * @param msg2 second message part
43 void Debug::Verbose(int level, const char *msg1, const char *msg2)
45 if (level > DebugLevel)
49 std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
55 * @param msg1 first message part
56 * @param msg2 second message part
58 void Debug::Error(bool test, const char *msg1, const char *msg2)
64 std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
70 * @param msg1 first message part
71 * @param msg2 second message part
72 * @param msg3 Third message part
74 void Debug::Error(const char *msg1, const char *msg2,
77 std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3
86 * @param msg1 first message part
87 * @param msg2 second message part
89 void Debug::Assert(int level, bool test, const char *msg1,
92 if (level > DebugLevel)
98 std::cerr << "gdcm::" << msg1 << ' ' << msg2
105 * @param a return code
107 void Debug::Exit(int a)
109 exit(a); // Found in #include <stdlib.h>
112 } // end namespace gdcm