Elaztek Developer Hub
Blamite Game Engine - Strings  00326.06.27.21.0407.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamBasicLogger Class Reference

Class representing a basic logger. More...

#include <logger.h>

Public Member Functions

 BlamBasicLogger ()
 Initializes a new logger. More...
 
 BlamBasicLogger (int _unique_id)
 Initializes a new logger with a unique ID. More...
 
void ClearHistory ()
 Clears all log history. More...
 
std::vector< BlamBasicLogMessageGetHistory ()
 Retrieves the log history. More...
 
void LogEvent (BlamBasicLogMessage message)
 Writes a message to the log. More...
 
void LogEvent (std::string message)
 Writes a message to the log. More...
 
void LogEvent (std::string message, BlamLogLevel log_level)
 Writes a message to the log. More...
 
void LogEvent (std::string message, TerminalColor color)
 Writes a message to the log. More...
 
void AddReceiver (BlamLogReceiver *receiver)
 Registers a receiver to this logger. More...
 
void RemoveReceiver (BlamLogReceiver *receiver)
 Unregisters a receiver from this logger. More...
 

Detailed Description

Class representing a basic logger.

In order to avoid having multiple applications implement their own logging systems, they can instead use one of these. This logger provides basic logging functionality. It does not organize log messages into reports, so the engine itself wouldn't be able to use one of these. But many of the editing tools do not require the use of reports, so all that is needed is a simple log.

Constructor & Destructor Documentation

◆ BlamBasicLogger() [1/2]

BlamBasicLogger::BlamBasicLogger ( )

Initializes a new logger.

◆ BlamBasicLogger() [2/2]

BlamBasicLogger::BlamBasicLogger ( int  _unique_id)

Initializes a new logger with a unique ID.

Parameters
_unique_id- The ID to give to the logger, can be used to determine where log messages originate.

Member Function Documentation

◆ AddReceiver()

void BlamBasicLogger::AddReceiver ( BlamLogReceiver receiver)

Registers a receiver to this logger.

The receiver will be notified whenever a new log message is received.

Parameters
receiver- The receiver to add.

◆ ClearHistory()

void BlamBasicLogger::ClearHistory ( )

Clears all log history.

Cannot be undone.

◆ GetHistory()

std::vector< BlamBasicLogMessage > BlamBasicLogger::GetHistory ( )

Retrieves the log history.

Returns
The log history.

◆ LogEvent() [1/4]

void BlamBasicLogger::LogEvent ( BlamBasicLogMessage  message)

Writes a message to the log.

Parameters
message- The new message to log.

◆ LogEvent() [2/4]

void BlamBasicLogger::LogEvent ( std::string  message)

Writes a message to the log.

Parameters
message- The new message to log.

◆ LogEvent() [3/4]

void BlamBasicLogger::LogEvent ( std::string  message,
BlamLogLevel  log_level 
)

Writes a message to the log.

Parameters
message- The new message to log.
log_level- The log level of the message.

◆ LogEvent() [4/4]

void BlamBasicLogger::LogEvent ( std::string  message,
TerminalColor  color 
)

Writes a message to the log.

Parameters
message- The new message to log.
color- The color to use when printing the message to the standard output.

◆ RemoveReceiver()

void BlamBasicLogger::RemoveReceiver ( BlamLogReceiver receiver)

Unregisters a receiver from this logger.

The receiver will no longer be notified whenever a new log message is received.

Parameters
receiver- The receiver to remove.

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