X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDebug.cxx;h=d301a9bf69297b1e0129ffb682fcdc4e54f7ee2f;hb=327dfe7647e3720b0f3125f9b19397cb9afc0ed3;hp=a2e8f3d3ebc4140b8fd80706f0f25eabdcf789f0;hpb=1d69b92978803204089d270599133917d944c651;p=gdcm.git diff --git a/src/gdcmDebug.cxx b/src/gdcmDebug.cxx index a2e8f3d3..d301a9bf 100644 --- a/src/gdcmDebug.cxx +++ b/src/gdcmDebug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.cxx,v $ Language: C++ - Date: $Date: 2004/10/12 04:35:44 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -47,13 +47,13 @@ void Debug::SetDebug(int level) * @param msg1 first message part * @param msg2 second message part */ -void Debug::Verbose(int level, const char * msg1, const char * msg2) +void Debug::Verbose(int level, const char *msg1, const char *msg2) { if (level > DebugLevel) { return ; } - std::cerr << msg1 << ' ' << msg2 << std::endl; + std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl << std::flush; } /** @@ -62,13 +62,13 @@ void Debug::Verbose(int level, const char * msg1, const char * msg2) * @param msg1 first message part * @param msg2 second message part */ -void Debug::Error(bool test, const char * msg1, const char * msg2) +void Debug::Error(bool test, const char *msg1, const char *msg2) { if (!test) { return; } - std::cerr << msg1 << ' ' << msg2 << std::endl; + std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl << std::flush; Exit(1); } @@ -78,10 +78,11 @@ void Debug::Error(bool test, const char * msg1, const char * msg2) * @param msg2 second message part * @param msg3 Third message part */ -void Debug::Error(const char* msg1, const char* msg2, - const char* msg3) +void Debug::Error(const char *msg1, const char *msg2, + const char *msg3) { - std::cerr << msg1 << ' ' << msg2 << ' ' << msg3 << std::endl; + std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3 + << std::endl << std::flush; Exit(1); } @@ -92,8 +93,8 @@ void Debug::Error(const char* msg1, const char* msg2, * @param msg1 first message part * @param msg2 second message part */ -void Debug::Assert(int level, bool test, const char * msg1, - const char * msg2) +void Debug::Assert(int level, bool test, const char *msg1, + const char *msg2) { if (level > DebugLevel) { @@ -101,7 +102,8 @@ void Debug::Assert(int level, bool test, const char * msg1, } if (!test) { - std::cerr << msg1 << ' ' << msg2 << std::endl; + std::cerr << "gdcm::" << msg1 << ' ' << msg2 + << std::endl << std::flush; } } @@ -114,7 +116,7 @@ void Debug::Exit(int a) #ifdef __GNUC__ std::exit(a); #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) exit(a); // Found in #include #endif }