![]() |
Blamite Game Engine - Strings
00386.06.16.23.0646.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
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< BlamBasicLogMessage > | GetHistory () |
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... | |
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.
BlamBasicLogger::BlamBasicLogger | ( | ) |
Initializes a new logger.
BlamBasicLogger::BlamBasicLogger | ( | int | _unique_id | ) |
Initializes a new logger with a unique ID.
_unique_id | - The ID to give to the logger, can be used to determine where log messages originate. |
void BlamBasicLogger::AddReceiver | ( | BlamLogReceiver * | receiver | ) |
Registers a receiver to this logger.
The receiver will be notified whenever a new log message is received.
receiver | - The receiver to add. |
void BlamBasicLogger::ClearHistory | ( | ) |
Clears all log history.
Cannot be undone.
std::vector< BlamBasicLogMessage > BlamBasicLogger::GetHistory | ( | ) |
Retrieves the log history.
void BlamBasicLogger::LogEvent | ( | BlamBasicLogMessage | message | ) |
Writes a message to the log.
message | - The new message to log. |
void BlamBasicLogger::LogEvent | ( | std::string | message | ) |
Writes a message to the log.
message | - The new message to log. |
void BlamBasicLogger::LogEvent | ( | std::string | message, |
BlamLogLevel | log_level | ||
) |
Writes a message to the log.
message | - The new message to log. |
log_level | - The log level of the message. |
void BlamBasicLogger::LogEvent | ( | std::string | message, |
TerminalColor | color | ||
) |
Writes a message to the log.
message | - The new message to log. |
color | - The color to use when printing the message to the standard output. |
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.
receiver | - The receiver to remove. |
void BlamBasicLogger::SetCommandLinePrintingEnabled | ( | bool | print_to_cmd | ) |
Sets whether or not log messages should be written to the standard output.
print_to_cmd | - Whether or not to print messages to stdout. |