PARTONS/ElementaryUtils  
Basic utility softwares (Logger, threads, etc)
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ElemUtils::LoggerManager Class Reference

<singleton> Handles logs. More...

Inheritance diagram for ElemUtils::LoggerManager:
ElemUtils::Thread

Public Member Functions

virtual ~LoggerManager ()
 Default destructor. More...
 
void init ()
 
void close ()
 
void defineLevel (LoggerLevel loggerLevel)
 
void run ()
 Main function executed by the thread. More...
 
void debug (const std::string &className, const std::string &functionName, const std::string &message)
 
void info (const std::string &className, const std::string &functionName, const std::string &message)
 
void warn (const std::string &className, const std::string &functionName, const std::string &message)
 
void error (const std::string &className, const std::string &functionName, const std::string &message)
 
void error (const CustomException &customException)
 
void addMessageToBuffer (LoggerMessage loggerMessage)
 
std::string toString ()
 
void flushBuffer ()
 
- Public Member Functions inherited from ElemUtils::Thread
 Thread ()
 Default constructor. More...
 
virtual ~Thread ()
 Default destructor. More...
 
virtual Threadclone () const
 
void launch ()
 
void wait ()
 

Static Public Member Functions

static LoggerManagergetInstance ()
 

Private Member Functions

 LoggerManager ()
 Private default constructor for a unique instance. More...
 
void parseConfigurationFile (const std::string &filePath)
 
void update ()
 
bool isLoggable (LoggerMessage loggerMessage)
 
void writeConsole ()
 
void writeFile ()
 

Private Attributes

sf::Mutex m_mutex
 
std::ofstream m_fileOutputStream
 
std::string m_outputFilePath
 
LoggerLevel m_defaultLevel
 
LoggerPrintMode m_printMode
 
std::map< std::string, LoggerClassLevel * > m_customClassLevels
 
std::map< std::string, LoggerClassLevel * >::iterator m_it
 
std::string m_buffer
 
bool m_active
 

Static Private Attributes

static LoggerManagerm_pInstance = 0
 

Additional Inherited Members

- Protected Member Functions inherited from ElemUtils::Thread
 Thread (const Thread &other)
 

Detailed Description

<singleton> Handles logs.

Constructor & Destructor Documentation

◆ ~LoggerManager()

ElemUtils::LoggerManager::~LoggerManager ( )
virtual

Default destructor.

◆ LoggerManager()

ElemUtils::LoggerManager::LoggerManager ( )
private

Private default constructor for a unique instance.

Member Function Documentation

◆ addMessageToBuffer()

void ElemUtils::LoggerManager::addMessageToBuffer ( LoggerMessage  loggerMessage)

◆ close()

void ElemUtils::LoggerManager::close ( )

◆ debug()

void ElemUtils::LoggerManager::debug ( const std::string &  className,
const std::string &  functionName,
const std::string &  message 
)

◆ defineLevel()

void ElemUtils::LoggerManager::defineLevel ( LoggerLevel  loggerLevel)

◆ error() [1/2]

void ElemUtils::LoggerManager::error ( const CustomException customException)

◆ error() [2/2]

void ElemUtils::LoggerManager::error ( const std::string &  className,
const std::string &  functionName,
const std::string &  message 
)

◆ flushBuffer()

void ElemUtils::LoggerManager::flushBuffer ( )

◆ getInstance()

LoggerManager * ElemUtils::LoggerManager::getInstance ( )
static

◆ info()

void ElemUtils::LoggerManager::info ( const std::string &  className,
const std::string &  functionName,
const std::string &  message 
)

◆ init()

void ElemUtils::LoggerManager::init ( )

◆ isLoggable()

bool ElemUtils::LoggerManager::isLoggable ( LoggerMessage  loggerMessage)
private

◆ parseConfigurationFile()

void ElemUtils::LoggerManager::parseConfigurationFile ( const std::string &  filePath)
private

◆ run()

void ElemUtils::LoggerManager::run ( )
virtual

Main function executed by the thread.

Reimplemented from ElemUtils::Thread.

◆ toString()

std::string ElemUtils::LoggerManager::toString ( )

◆ update()

void ElemUtils::LoggerManager::update ( )
private

◆ warn()

void ElemUtils::LoggerManager::warn ( const std::string &  className,
const std::string &  functionName,
const std::string &  message 
)

◆ writeConsole()

void ElemUtils::LoggerManager::writeConsole ( )
private

◆ writeFile()

void ElemUtils::LoggerManager::writeFile ( )
private

Member Data Documentation

◆ m_active

bool ElemUtils::LoggerManager::m_active
private

◆ m_buffer

std::string ElemUtils::LoggerManager::m_buffer
private

◆ m_customClassLevels

std::map<std::string, LoggerClassLevel*> ElemUtils::LoggerManager::m_customClassLevels
private

◆ m_defaultLevel

LoggerLevel ElemUtils::LoggerManager::m_defaultLevel
private

◆ m_fileOutputStream

std::ofstream ElemUtils::LoggerManager::m_fileOutputStream
private

◆ m_it

std::map<std::string, LoggerClassLevel*>::iterator ElemUtils::LoggerManager::m_it
private

◆ m_mutex

sf::Mutex ElemUtils::LoggerManager::m_mutex
private

◆ m_outputFilePath

std::string ElemUtils::LoggerManager::m_outputFilePath
private

◆ m_pInstance

LoggerManager * ElemUtils::LoggerManager::m_pInstance = 0
staticprivate

◆ m_printMode

LoggerPrintMode ElemUtils::LoggerManager::m_printMode
private

The documentation for this class was generated from the following files: