1 /*=========================================================================
4 Module: $RCSfile: gdcmDebug.cxx,v $
6 Date: $Date: 2004/07/19 11:51:26 $
7 Version: $Revision: 1.3 $
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)
54 std::cerr << Msg1 << ' ' << Msg2 << std::endl;
60 * @param Msg1 first message part
61 * @param Msg2 second message part
63 void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2)
67 std::cerr << Msg1 << ' ' << Msg2 << std::endl;
73 * @param Msg1 first message part
74 * @param Msg2 second message part
75 * @param Msg3 Third message part
77 void gdcmDebug::Error(const char* Msg1, const char* Msg2,
80 std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << std::endl;
88 * @param Msg1 first message part
89 * @param Msg2 second message part
91 void gdcmDebug::Assert(int Level, bool Test,
92 const char * Msg1, const char * Msg2)
94 if (Level > DebugLevel)
97 std::cerr << Msg1 << ' ' << Msg2 << std::endl;
102 * @param a return code
104 void gdcmDebug::Exit(int a)
110 exit(a); // Found in #include <stdlib.h>
115 * \brief Get the debug instance
116 * \return Reference to the debug instance
118 gdcmDebug &gdcmDebug::GetReference()
120 return gdcmDebug::debug;