Status of ITK Logger classes?

ITK has this group of Logger and LogOutput classes, originally by Hee-Su Kim, and included with ITK in 2005:

Are they still recommended to be used within a new application? Because they look rather old, and there are more modern third party logging libraries around now.

1 Like

@Niels_Dekker SimpleITK uses them. They were required to redirect messages from ITK to loggers on different platforms and languages. Here is our example usage:

And the related C++ classes:

I see these ITK classes as base classes for derived classes which interact with these third party logging libraries.

Not all messages go through these loggers, especially third party IO libraries.

1 Like

Thanks @blowekamp So clearly the ITK logger classes are still actively being used :+1:

I’m sorry to say I don’t like the output format that much. For example,

logger->Error("Hello ITK Log!\n");

Appears to produce something like:

1675253635.914951324462890625 : (CRITICAL) Hello ITK Log!

This prefix in the output, “time-in-seconds : (CRITICAL)” comes from LoggerBase::BuildFormattedEntry, apparently:

Do you also get the output like that in SimpleITK?

I think a typical usages is some of the itk macros like itkWarningMacro.

I don’t think what SimpleITK using goes through those lines… I recall the extra stuff being added to the message from the macro ( linked above ), that I didn’t think should be in the message.

I think the classes were over engineered (for some old project like IGSTK), and have some dead code and unneeded features.

1 Like

Thanks @blowekamp but as far as I can see, itkWarningMacro does not use ITK’s Logger classes. (I mean, the classes by Hee-Su Kim). Looking at:

Interestingly, ITK’s Logger classes appear to ignore the GlobalWarningDisplay property! They do have their own macro’s, itkLogMacro and itkLogMacroStatic as I see in itkMacro.h.

O, it looks like SimpleITK deals with overriding the OutputWindow class not the Logger class. The two are similar and confusing.

1 Like