#include <gdcmDebug.h>
Public Member Functions | |
Debug () | |
~Debug () | |
Static Public Member Functions | |
static void | SetDebugFlag (bool flag) |
Sets both the debug flag and warning flag (both used for debugging purpose). | |
static bool | GetDebugFlag () |
Gets the debug flag value. | |
static void | DebugOn () |
Sets the Debug Flag to true. | |
static void | DebugOff () |
Sets the Debug Flag to false. | |
static void | SetLogFlag (bool flag) |
Sets the log flag. | |
static bool | GetLogFlag () |
Gets the Log flag value. | |
static void | LogOn () |
Sets the Log Flag to true. | |
static void | LogOff () |
Sets the Log Flag to false. | |
static void | SetWarningFlag (bool flag) |
Sets the warning flag. | |
static bool | GetWarningFlag () |
Gets the warning flag value. | |
static void | WarningOn () |
Sets the Warning Flag to true. | |
static void | WarningOff () |
Sets the Warning Flag to false. | |
static void | SetOutputToFile (bool flag) |
Accessor. | |
static bool | GetOutputToFile () |
Accessor to know whether debug info are redirected to file. | |
static void | OutputToFileOn () |
Next debug messages will be sent in the debug file. | |
static void | OutputToFileOff () |
Next debug messages will be sent in the standard output. | |
static void | SetOutputFileName (std::string const &filename) |
Set the filename the debug stream should be redirect to Settting a filename also sets DebugToFile to true. | |
static std::ostream & | GetOutput () |
Internal use only. Allow us to retrieve the static from anywhere in gdcm code. | |
static void | SendToOutput (unsigned int type, std::string const &msg, const Base *object=NULL) |
Static Private Attributes | |
static bool | WarningFlag = false |
static bool | LogFlag = false |
static bool | DebugFlag = false |
static bool | OutputToFile = false |
static std::ofstream | OutputFileStream |
static std::ostream & | StandardStream = std::cerr |
static const int | LINE_LENGTH = 79 |
A debugging message is only shown if the flag is on (DebugFlag) This is static var and can be set at beginning of code: GDCM_NAME_SPACE::Debug::SetDebugOn();
Warning : Warns the user when some oddity occured, and we used an heuristics to bypass the trouble. e.g. : SamplesPerPixel missing, we assume it's a grey level image e.g : Pixel Representation missing : we assume 'unsigned' (we hope our assumption is OK, but user may disagree.) Log : we display messages when anything is not Dicom Kosher e.g. : non even length field e.g : file is declared as Explicit VR, but a DataElement is Implicit e.g : a file holds an illegal group (0x0005, ...) Debug : We help developper to trace, at a glance, the execution. (before refining with a debugging tool)
Setting ON Debug leads to set ON Warning (but not Log) Setting ON Log leads to set ON Warning (but not Debug)
Definition at line 70 of file gdcmDebug.h.
|
Definition at line 40 of file gdcmDebug.cxx.
|
|
Definition at line 44 of file gdcmDebug.cxx. References OutputFileStream. 00045 { 00046 if ( OutputFileStream.is_open() ) 00047 OutputFileStream.close(); 00048 }
|
|
Sets the Debug Flag to false.
Definition at line 85 of file gdcmDebug.h. 00085 { SetDebugFlag(false); }
|
|
Sets the Debug Flag to true.
Definition at line 83 of file gdcmDebug.h. 00083 { SetDebugFlag(true); }
|
|
Gets the debug flag value.
Definition at line 81 of file gdcmDebug.h. Referenced by GDCM_NAME_SPACE::Document::ParseDES(). 00081 {return DebugFlag; }
|
|
Gets the Log flag value.
Definition at line 91 of file gdcmDebug.h. 00091 {return LogFlag; }
|
|
Internal use only. Allow us to retrieve the static from anywhere in gdcm code.
Definition at line 130 of file gdcmDebug.cxx. References OutputFileStream, OutputToFile, and StandardStream. Referenced by SendToOutput(). 00131 { 00132 if(OutputToFile) 00133 return OutputFileStream; 00134 else 00135 return StandardStream; 00136 }
|
|
Accessor to know whether debug info are redirected to file.
Definition at line 104 of file gdcmDebug.cxx. References OutputToFile. 00105 { 00106 return OutputToFile; 00107 }
|
|
Gets the warning flag value.
Definition at line 101 of file gdcmDebug.h. 00101 {return WarningFlag; }
|
|
Sets the Log Flag to false.
Definition at line 95 of file gdcmDebug.h. 00095 { SetLogFlag(false); }
|
|
Sets the Log Flag to true.
Definition at line 93 of file gdcmDebug.h. 00093 { SetLogFlag(true); }
|
|
Next debug messages will be sent in the standard output.
Definition at line 114 of file gdcmDebug.h. 00114 { SetOutputToFile(false); }
|
|
Next debug messages will be sent in the debug file.
Definition at line 112 of file gdcmDebug.h. 00112 { SetOutputToFile(true); }
|
|
Definition at line 138 of file gdcmDebug.cxx. References GDCM_NAME_SPACE::CMD_ASSERT, GDCM_NAME_SPACE::CMD_DEBUG, GDCM_NAME_SPACE::CommandManager::ExecuteCommandConst(), GDCM_NAME_SPACE::Command::GetCommandAsString(), and GetOutput(). 00139 { 00140 bool executed=false; 00141 if( type != CMD_DEBUG && type != CMD_ASSERT ) 00142 executed=CommandManager::ExecuteCommandConst(object,type,msg); 00143 00144 if(!executed) 00145 GetOutput() << Command::GetCommandAsString(type) << ": " << msg; 00146 }
|
|
Sets both the debug flag and warning flag (both used for debugging purpose).
Definition at line 57 of file gdcmDebug.cxx. References DebugFlag, and WarningFlag. 00058 { 00059 // To help tracking a bug, both flags are necessary 00060 DebugFlag = flag; 00061 WarningFlag = flag; 00062 }
|
|
Sets the log flag.
Definition at line 85 of file gdcmDebug.cxx. References LogFlag, and WarningFlag. 00086 { 00087 // To log oddities, both flags are necessary 00088 WarningFlag = flag; 00089 LogFlag = flag; 00090 }
|
|
Set the filename the debug stream should be redirect to Settting a filename also sets DebugToFile to true.
Definition at line 116 of file gdcmDebug.cxx. References DebugFlag, OutputFileStream, and OutputToFile. 00117 { 00118 OutputToFile = true; // Just in case ... 00119 DebugFlag = true; // Just in case ... 00120 if ( OutputFileStream.is_open() ) 00121 OutputFileStream.close(); 00122 OutputFileStream.open( filename.c_str() ); 00123 }
|
|
Accessor.
Definition at line 96 of file gdcmDebug.cxx. References OutputToFile. 00097 { 00098 OutputToFile = flag; 00099 }
|
|
Sets the warning flag.
Definition at line 68 of file gdcmDebug.cxx. References DebugFlag, LogFlag, and WarningFlag. 00069 { 00070 // Cannot unset Warning flag if Debug flag is on or if LogFlag is on. 00071 if (flag == false) 00072 { 00073 if (DebugFlag == true) 00074 return; 00075 if (LogFlag == true) 00076 return; 00077 } 00078 WarningFlag = flag; 00079 }
|
|
Sets the Warning Flag to false.
Definition at line 105 of file gdcmDebug.h. 00105 { SetWarningFlag(false); }
|
|
Sets the Warning Flag to true.
Definition at line 103 of file gdcmDebug.h. 00103 { SetWarningFlag(true); }
|
|
Definition at line 126 of file gdcmDebug.h. Referenced by SetDebugFlag(), SetOutputFileName(), and SetWarningFlag(). |
|
Definition at line 133 of file gdcmDebug.h. |
|
Definition at line 125 of file gdcmDebug.h. Referenced by SetLogFlag(), and SetWarningFlag(). |
|
Definition at line 130 of file gdcmDebug.h. Referenced by GetOutput(), SetOutputFileName(), and ~Debug(). |
|
Definition at line 128 of file gdcmDebug.h. Referenced by GetOutput(), GetOutputToFile(), SetOutputFileName(), and SetOutputToFile(). |
|
Definition at line 131 of file gdcmDebug.h. Referenced by GetOutput(). |
|
Definition at line 124 of file gdcmDebug.h. Referenced by SetDebugFlag(), SetLogFlag(), and SetWarningFlag(). |