Exemplo n.º 1
0
void mitk::LoggingBackend::ProcessMessage(const mbilog::LogMessage &l)
{
  logMutex.Lock();
#ifdef _WIN32
  FormatSmart(l, (int)GetCurrentThreadId());
#else
  FormatSmart(l);
#endif

  if (logFile)
  {
#ifdef _WIN32
    FormatFull(*logFile, l, (int)GetCurrentThreadId());
#else
    FormatFull(*logFile, l);
#endif
  }
  if (logOutputWindow)
  {
    if (outputWindow == nullptr)
    {
      outputWindow = new std::stringstream();
    }
    outputWindow->str("");
    outputWindow->clear();
#ifdef _WIN32
    FormatFull(*outputWindow, l, (int)GetCurrentThreadId());
#else
    FormatFull(*outputWindow, l);
#endif
    itk::OutputWindow::GetInstance()->DisplayText(outputWindow->str().c_str());
  }
  logMutex.Unlock();
}
Exemplo n.º 2
0
void mbilog::BackendCout::ProcessMessage(const mbilog::LogMessage& l)
{
  if(m_useFullOutput)
    FormatFull(l);
  else
    FormatSmart(l);
}