[Dcmlib] DebugMacro vs WarningMacro

Jean-Pierre Roux Jean-Pierre.Roux at creatis.insa-lyon.fr
Wed Oct 26 16:37:33 CEST 2005


Mathieu Malaterre wrote:

> Jean-Pierre Roux wrote:
>
>> Hi, everybody .
>>
>> Some times ago I read (well. .. I saw) some commit explaining we 
>> don't have to mixture DebugMacro and WarningMacro.
>>
>> I don't remember what was the purpose, but I'm not sure messages such 
>> as :
>> "Last system error was: Success".
>> was expected.
>>
>> Anyway, have we got really 'Warning' messages to ouput to the 
>> 'normal' user?
>> Almost all I can find are informations we give the developper, to 
>> inform him how the process is running.
>>
>> Any opinion?
>
>
> My goal is that Debug is for Debug, for developer. 

I do agree with you.
We need both, and we'll need to deferenciate them.
What I disagree is the way "Debug' and 'Warning' are used in the code.

Debug *is* an information we give the developpers -us- to track the 
problemes.
Warning in an info we give end user to tell him the File is not quite OK.

Therefore , e.g. in gdcmDocument :
gdcmWarningMacro("True DICOM File, with NO Tansfer Syntax: " << ts );
*is* a Warning (--> Shame of image manufacturer!)

if ( Global::GetTS()->GetSpecialTransferSyntax(ts) == 
TS::ExplicitVRBigEndian ) {
gdcmWarningMacro("Transfer Syntax Name = [" << GetTransferSyntaxName() 
<< "]" );

*is not* a Warning, it's a debug info (nobody but the bug tracking 
developper cares about it)

--> Well ...
Actually, what I disagreed were the messages ""Last system error was: 
Success".
(no information : noise ;-)

> The Warning mechanism is right now identical to Debug (output to the 
> same stream as Debug). But I would like later to generate output like 
> dciodvfy, therefore I *need* to differenciate what a debug comment is 
> from a warning 'we process this DICOM file only because we are smart 
> enough'.

Quite OK !

>
>
> Basically the gdcmWarningMacro could output to std::log or a specific 
> file if we ever write a 'dciodvfy' like.
>
> BTW when debugging with bcc5.5, I found extremely usefull to have 
> strerror() displayed. Therefore when gdcm start failing and I read 
> that the file was not open properly (file permissions...) I don't have 
> to waste my time. So yes I would like to keep this in DebugMacro.
>
> 2 cents,
> Mathieu
>




More information about the Dcmlib mailing list