Elaztek Developer Hub
Blamite Game Engine - Strings  00386.06.16.23.0646.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...
 
void SetCommandLinePrintingEnabled (bool print_to_cmd)
 Sets whether or not log messages should be written to the standard output. 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.

+ Here is the call graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ LogEvent() [1/4]

void BlamBasicLogger::LogEvent ( BlamBasicLogMessage  message)

Writes a message to the log.

Parameters
message- The new message to log.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LogEvent() [2/4]

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

Writes a message to the log.

Parameters
message- The new message to log.
+ Here is the call graph for this function:

◆ 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.
+ Here is the call graph for this function:

◆ 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.
+ Here is the call graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ SetCommandLinePrintingEnabled()

void BlamBasicLogger::SetCommandLinePrintingEnabled ( bool  print_to_cmd)

Sets whether or not log messages should be written to the standard output.

Parameters
print_to_cmd- Whether or not to print messages to stdout.

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