Classes | Enumerations | Functions | Variables

mbilog Namespace Reference

Classes

class  LogMessage
struct  AbstractBackend
class  BackendCout
class  PseudoStream
class  NullStream

Enumerations

enum  {
  Info, Warn, Error, Fatal,
  Debug
}

Functions

void RegisterBackend (AbstractBackend *backend)
void UnregisterBackend (AbstractBackend *backend)
void DistributeToBackends (LogMessage &l)

Variables

static const std::string NA_STRING = "n/a"

Enumeration Type Documentation

anonymous enum
Enumerator:
Info 
Warn 
Error 
Fatal 
Debug 

Definition at line 44 of file mbilog.h.


Function Documentation

void mbilog::DistributeToBackends ( mbilog::LogMessage l )

Definition at line 45 of file mbilog.cpp.

References backends, mbilog::BackendCout::FormatSmart(), and mbilog::LogMessage::message.

Referenced by mbilog::PseudoStream::~PseudoStream().

{

  // Crop Message
  {
    std::string::size_type i = l.message.find_last_not_of(" \t\f\v\n\r");
    l.message = (i != std::string::npos) ? l.message.substr(0, i+1) : "";
  }
  
  if(backends.empty())
  {
    mbilog::BackendCout::FormatSmart(l);
    return;
  }

  std::list<mbilog::AbstractBackend*>::iterator i;

  for(i = backends.begin(); i != backends.end(); i++)
    (*i)->ProcessMessage(l);
}
void mbilog::RegisterBackend ( mbilog::AbstractBackend backend )

Definition at line 35 of file mbilog.cpp.

References backends.

Referenced by mitk::LoggingBackend::Register().

{
  backends.push_back(backend);
}
void mbilog::UnregisterBackend ( mbilog::AbstractBackend backend )

Definition at line 40 of file mbilog.cpp.

References backends.

Referenced by mitk::LoggingBackend::Unregister().

{
  backends.remove(backend);
}

Variable Documentation

const std::string mbilog::NA_STRING = "n/a" [static]

Definition at line 32 of file mbilog.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines