[Insight-users] File and linenumber info when using the itk:Logger ?

motes motes mort.motes at gmail.com
Tue Mar 2 09:30:31 EST 2010


I am using the itk:Logger in my application:




#include "itkLogger.h"
#include "itkStdStreamLogOutput.h"

int main(){

  itk::StdStreamLogOutput::Pointer output = itk::StdStreamLogOutput::New();
  output->SetStream(std::cout);
  itk::Logger::Pointer logger = itk::Logger::New();
  logger->SetName("RegistrationLogger");
  logger->SetTimeStampFormat(itk::LoggerBase::HUMANREADABLE);
  logger->SetPriorityLevel(itk::LoggerBase::INFO);
  logger->AddLogOutput(output);
  logger->Write(itk::LoggerBase::INFO, "doing stuff\n");

return 0;

}

when I run the above app I get:

2010 Mar 02 15:26:44  :  RegistrationLogger  (INFO) doing stuff

But is it not possible to get file and linenumber information added
automatically like when using eg. log4cxx ?


More information about the Insight-users mailing list