BARE2D
BARE2D::Logger Class Reference

For general purpose logging, this is the logger! It is a singleton class. More...

#include <Logger.hpp>

+ Collaboration diagram for BARE2D::Logger:

Public Member Functions

void log (std::string message, bool important=false)
 Logs a message to a file and the terminal. More...
 

Static Public Member Functions

static LoggergetInstance ()
 

Private Member Functions

 Logger ()
 
 ~Logger ()
 

Private Attributes

std::ofstream m_logFile
 

Static Private Attributes

static Loggerm_instance = nullptr
 

Detailed Description

For general purpose logging, this is the logger! It is a singleton class.

Definition at line 12 of file Logger.hpp.

Constructor & Destructor Documentation

◆ Logger()

BARE2D::Logger::Logger ( )
private

Definition at line 11 of file Logger.cpp.

References BARE2D::LOGGER_FAILURE, m_logFile, and BARE2D::throwFatalError().

Referenced by getInstance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~Logger()

BARE2D::Logger::~Logger ( )
private

Member Function Documentation

◆ getInstance()

◆ log()

void BARE2D::Logger::log ( std::string  message,
bool  important = false 
)

Logs a message to a file and the terminal.

Parameters
messageThe message to log
importantIf this is set to true, the message will be surrounded with hashes. This implies importance!
Parameters
important= false

Definition at line 42 of file Logger.cpp.

References m_logFile.

Referenced by BARE2D::ResourceManager::clearCaches(), BARE2D::XMLDataManager::getDataCache(), BARE2D::XMLDataManager::loadXML(), MessageCallback(), BARE2D::LuaFunctions::print(), BARE2D::XMLData::read(), BARE2D::IOManager::readFileToBuffer(), BARE2D::XMLDataManager::readXMLData(), BARE2D::XMLDataManager::saveXML(), BARE2D::BARECEGUI::setActiveContext(), and BARE2D::XMLDataManager::writeXMLData().

+ Here is the caller graph for this function:

Field Documentation

◆ m_instance

Logger * BARE2D::Logger::m_instance = nullptr
staticprivate

Definition at line 31 of file Logger.hpp.

Referenced by getInstance().

◆ m_logFile

std::ofstream BARE2D::Logger::m_logFile
private

Definition at line 29 of file Logger.hpp.

Referenced by log(), and Logger().


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