[IGSTK-Developers] Re: ITK Logger Bug

Luis Ibanez luis.ibanez at kitware.com
Fri May 11 07:23:04 EDT 2007


Hi Patrick,

Thanks for pointing this out.

You are right, "break"s were missing
from the switch statement.

A fix has been committed now.

A test case was added to itkLoggerTest.cxx.

I couldn't reproduce the problem you reported
with the Exception. Maybe we should experiment
with other combinations of the format string.



    Luis



-----------------------
Patrick Cheng wrote:
> Hi Luis,
> 
> Thank you for the fix. However I found two problems:
> 
> 1) in itkLoggerBase.cxx line 73, there should be a "break"
> 
> 2) My system doesn't seem to support this call:
>    itksys::SystemTools::GetCurrentDateTime("%Y %b %d %R %S");
>    It throws an exception as in attached image.
> 
> Patrick
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Patrick,
>>
>>
>> 1)  Thanks for pointing out this bug in ITK.
>>     A fix has now been committed for it.
>>
>>
>> 2) The functionality of writing out the time
>>    in a human-readable format has also been
>>    added to the itkLoggerBase class. You will
>>    have to update your ITK checkout in order
>>    to get this functionality.
>>
>>
>>    You should call in your logger the method:
>>
>>       logger->SetTimeStampFormat( itk::LoggerBase::HUMANREADABLE );
>>
>>    to get the time stamp in the format
>>    year, month, day, hours, minutes, seconds.
>>
>>    or you could call
>>
>>       logger->SetTimeStampFormat( itk::LoggerBase::REALVALUE );
>>
>>    in order to get the standard behavior, printing the
>>    time stamp in milliseconds.
>>
>>
>>
>> If you have a chance,
>> please give it a try and let us know if you find any problem.
>>
>>
>>
>>     Thanks
>>
>>
>>        Luis
>>
>>
>>
>> --------------------
>> Patrick Cheng wrote:
>>
>>> Hi Luis and Andinet,
>>>
>>> There is a minor bug in itkLoggerBase.cxx line 62
>>> I believe the third string should be "CRITICAL" instead of "ERROR" 
>>> according to the enum.
>>>
>>> Could you guys also add the feature of logging formated time early 
>>> next week? I really appreciate it.
>>>
>>> 4989 igstkLogMacro() & TimeStamp should output time in brokendown 
>>> date/time, instdead of milliseconds. Have both options, milliseconds 
>>> for easy computation, and broken down time for readability
>>>
>>> Thank you.
>>>
>>> Patrick
>>>
>>
>>
>>
> 
> ------------------------------------------------------------------------
> 



More information about the IGSTK-Developers mailing list