Pulse adds COVID-19 Simulation Support
×

#include <Logger.h>

Public Types

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

Public Member Functions

 Logger (std::string const &logFilename=Loggable::empty)
 
virtual ~Logger ()
 
void LogToConsole (bool b)
 
bool IsLoggingToConsole ()
 
void SetLogFile (std::string const &logFilename=Loggable::empty)
 
void SetLogLevel (Level level)
 
Level GetLogLevel ()
 
virtual void SetLogTime (const SEScalarTime *time)
 
virtual void SetForward (LoggerForward *forward)
 
virtual bool HasForward ()
 
virtual void Debug (std::string const &msg, std::string const &origin=Loggable::empty)
 
virtual void Debug (std::stringstream &msg, std::string const &origin=Loggable::empty)
 
virtual void Debug (std::ostream &msg, std::string const &origin=Loggable::empty)
 
virtual void Info (std::string const &msg, std::string const &origin=Loggable::empty)
 
virtual void Info (std::stringstream &msg, std::string const &origin=Loggable::empty)
 
virtual void Info (const std::stringstream &msg, std::string const &origin=Loggable::empty)
 
virtual void Info (std::ostream &msg, std::string const &origin=Loggable::empty)
 
virtual void Warning (std::string const &msg, std::string const &origin=Loggable::empty)
 
virtual void Warning (std::stringstream &msg, std::string const &origin=Loggable::empty)
 
virtual void Warning (std::ostream &msg, std::string const &origin=Loggable::empty)
 
virtual void Error (std::string const &msg, std::string const &origin=Loggable::empty)
 
virtual void Error (std::stringstream &msg, std::string const &origin=Loggable::empty)
 
virtual void Error (std::ostream &msg, std::string const &origin=Loggable::empty)
 
virtual void Fatal (std::string const &msg, std::string const &origin=Loggable::empty)
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=Loggable::empty)
 
virtual void Fatal (std::ostream &msg, std::string const &origin=Loggable::empty)
 
std::string to_string (int i)
 
std::string to_string (unsigned int i)
 
std::string to_string (size_t t)
 
std::string to_string (float f)
 
std::string to_string (double d)
 

Static Public Member Functions

static void Initialize ()
 
static void Deinitialize ()
 

Protected Member Functions

virtual std::string FormatLogMessage (std::string const &origin, std::string const &msg)
 

Protected Attributes

LoggerForwardm_Forward
 
const SEScalarTimem_time
 
std::stringstream m_ss
 

Private Attributes

friend Loggable
 
log_lib_log_lib
 

Member Enumeration Documentation

◆ Level

enum Logger::Level
strong
Enumerator
Debug 
Info 
Warn 
Error 
Fatal 

Constructor & Destructor Documentation

◆ Logger()

Logger::Logger ( std::string const &  logFilename = Loggable::empty)

◆ ~Logger()

Logger::~Logger ( )
virtual

Member Function Documentation

◆ Debug() [1/3]

void Logger::Debug ( std::string const &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Debug() [2/3]

void Logger::Debug ( std::stringstream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Debug() [3/3]

void Logger::Debug ( std::ostream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Deinitialize()

void Logger::Deinitialize ( )
static

◆ Error() [1/3]

void Logger::Error ( std::string const &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Error() [2/3]

void Logger::Error ( std::stringstream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Error() [3/3]

void Logger::Error ( std::ostream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Fatal() [1/3]

void Logger::Fatal ( std::string const &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Fatal() [2/3]

void Logger::Fatal ( std::stringstream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Fatal() [3/3]

void Logger::Fatal ( std::ostream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ FormatLogMessage()

std::string Logger::FormatLogMessage ( std::string const &  origin,
std::string const &  msg 
)
protectedvirtual

◆ GetLogLevel()

Logger::Level Logger::GetLogLevel ( )

◆ HasForward()

bool Logger::HasForward ( )
virtual

◆ Info() [1/4]

void Logger::Info ( std::string const &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Info() [2/4]

void Logger::Info ( std::stringstream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Info() [3/4]

void Logger::Info ( const std::stringstream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Info() [4/4]

void Logger::Info ( std::ostream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Initialize()

void Logger::Initialize ( )
static

◆ IsLoggingToConsole()

bool Logger::IsLoggingToConsole ( )

◆ LogToConsole()

void Logger::LogToConsole ( bool  b)

◆ SetForward()

void Logger::SetForward ( LoggerForward forward)
virtual

◆ SetLogFile()

void Logger::SetLogFile ( std::string const &  logFilename = Loggable::empty)

◆ SetLogLevel()

void Logger::SetLogLevel ( Logger::Level  l)

◆ SetLogTime()

void Logger::SetLogTime ( const SEScalarTime time)
virtual

◆ to_string() [1/5]

std::string Logger::to_string ( int  i)
inline

◆ to_string() [2/5]

std::string Logger::to_string ( unsigned int  i)
inline

◆ to_string() [3/5]

std::string Logger::to_string ( size_t  t)
inline

◆ to_string() [4/5]

std::string Logger::to_string ( float  f)
inline

◆ to_string() [5/5]

std::string Logger::to_string ( double  d)
inline

◆ Warning() [1/3]

void Logger::Warning ( std::string const &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Warning() [2/3]

void Logger::Warning ( std::stringstream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

◆ Warning() [3/3]

void Logger::Warning ( std::ostream &  msg,
std::string const &  origin = Loggable::empty 
)
virtual

Member Data Documentation

◆ _log_lib

log_lib* Logger::_log_lib
private

◆ Loggable

friend Logger::Loggable
private

◆ m_Forward

LoggerForward* Logger::m_Forward
protected

◆ m_ss

std::stringstream Logger::m_ss
protected

◆ m_time

const SEScalarTime* Logger::m_time
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.