1 /*=========================================================================
4 Module: $RCSfile: gdcmDebug.cxx,v $
6 Date: $Date: 2005/01/30 17:30:57 $
7 Version: $Revision: 1.19 $
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 =========================================================================*/
19 #include "gdcmDebug.h"
25 /// warning message level to be displayed
26 static bool DebugFlag = false;
27 static bool DebugToFile = false;
28 static std::ofstream DebugFile;
31 //-----------------------------------------------------------------------------
32 // Constructor / Destructor
41 if ( DebugFile.is_open() )
45 //-----------------------------------------------------------------------------
49 //-----------------------------------------------------------------------------
54 * @param flag Set the debug flag
56 void Debug::SetDebugFlag (bool flag)
63 * @param level Get the debug flag
65 bool Debug::GetDebugFlag ()
72 * @param flag Set the debug flag to redirect to file
74 void Debug::SetDebugToFile (bool flag)
81 * @param level Get the debug flag to redirect to file
83 bool Debug::GetDebugToFile ()
90 * @param flag Set the debug flag to redirect to file
91 * Absolutely nothing is check. You have to pass in
94 void Debug::SetDebugFilename (std::string const &filename)
96 DebugToFile = true; // Just in case ...
97 DebugFlag = true; // Just in case ...
98 if( DebugFile.is_open() )
100 DebugFile.open( filename.c_str() );
104 * \brief Get Accessor
107 std::ofstream &Debug::GetDebugFile ()
112 //-----------------------------------------------------------------------------
115 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
119 } // end namespace gdcm