1 /*=========================================================================
4 Module: $RCSfile: gdcmDebug.cxx,v $
6 Date: $Date: 2004/08/31 14:24:47 $
7 Version: $Revision: 1.5 $
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.htm 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"
22 //-----------------------------------------------------------------------------
23 gdcmDebug gdcmDebug::debug;
25 //-----------------------------------------------------------------------------
28 * @param level debug level
30 gdcmDebug::gdcmDebug(int level)
37 * @param level Set the debug level
39 void gdcmDebug::SetDebug(int level)
47 * @param msg1 first message part
48 * @param msg2 second message part
50 void gdcmDebug::Verbose(int level, const char * msg1, const char * msg2)
52 if (level > DebugLevel)
56 std::cerr << msg1 << ' ' << msg2 << std::endl;
62 * @param msg1 first message part
63 * @param msg2 second message part
65 void gdcmDebug::Error(bool test, const char * msg1, const char * msg2)
71 std::cerr << msg1 << ' ' << msg2 << std::endl;
77 * @param msg1 first message part
78 * @param msg2 second message part
79 * @param msg3 Third message part
81 void gdcmDebug::Error(const char* msg1, const char* msg2,
84 std::cerr << msg1 << ' ' << msg2 << ' ' << msg3 << std::endl;
92 * @param msg1 first message part
93 * @param msg2 second message part
95 void gdcmDebug::Assert(int level, bool test, const char * msg1,
98 if (level > DebugLevel)
104 std::cerr << msg1 << ' ' << msg2 << std::endl;
110 * @param a return code
112 void gdcmDebug::Exit(int a)
118 exit(a); // Found in #include <stdlib.h>
123 * \brief Get the debug instance
124 * \return Reference to the debug instance
126 gdcmDebug &gdcmDebug::GetReference()
128 return gdcmDebug::debug;