X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDebug.cxx;h=f5ffc7df456271af0a18a9bf08fadc5dea305f87;hb=5887c4beef24959af83e43efad0bb86acac9339e;hp=5eadc1643633437ed3989bac9de2452598210435;hpb=70b9dde9da207191fa6d799fdf03c2aff7941273;p=gdcm.git diff --git a/src/gdcmDebug.cxx b/src/gdcmDebug.cxx index 5eadc164..f5ffc7df 100644 --- a/src/gdcmDebug.cxx +++ b/src/gdcmDebug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 16:26:12 $ - Version: $Revision: 1.14 $ + Date: $Date: 2005/01/10 17:17:52 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,90 +23,26 @@ namespace gdcm { /// warning message level to be displayed -static int DebugLevel = -1; +static int DebugFlag = 0; //----------------------------------------------------------------------------- /** * \brief Accessor - * @param level Set the debug level + * @param flag Set the debug flag */ -void Debug::SetDebugLevel (int level) +void Debug::SetDebugFlag (int flag) { - DebugLevel = level; + DebugFlag = flag; } /** - * \brief Verbose - * @param level level - * @param msg1 first message part - * @param msg2 second message part - */ -void Debug::Verbose(int level, const char *msg1, const char *msg2) -{ - if (level > DebugLevel) - { - return ; - } - std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl; -} - -/** - * \brief Error - * @param test test - * @param msg1 first message part - * @param msg2 second message part - */ -void Debug::Error(bool test, const char *msg1, const char *msg2) -{ - if (!test) - { - return; - } - std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl; - Exit(1); -} - -/** - * \brief Error - * @param msg1 first message part - * @param msg2 second message part - * @param msg3 Third message part - */ -void Debug::Error(const char *msg1, const char *msg2, - const char *msg3) + * \brief Accessor + * @param level Get the debug flag + */ +int Debug::GetDebugFlag () { - std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3 - << std::endl; - Exit(1); + return DebugFlag; } -/** - * \brief Assert - * @param level level - * @param test test - * @param msg1 first message part - * @param msg2 second message part - */ -void Debug::Assert(int level, bool test, const char *msg1, - const char *msg2) -{ - if (level > DebugLevel) - { - return ; - } - if (!test) - { - std::cerr << "gdcm::" << msg1 << ' ' << msg2 - << std::endl; - } -} +} // end namespace gdcm -/** - * \brief Exit - * @param a return code - */ -void Debug::Exit(int a) -{ - exit(a); // Found in #include -} -} // end namespace gdcm