 |
Blamite Game Engine - blam!
00388.06.24.23.2301.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file.
6 #include <Strings/components/interface/logger/logger.h>
10 #define DEFAULT_LOG_FILENAME "debug"
36 std::string file_title =
"";
37 std::string file_path =
"";
39 bool stylized_html_logs =
false;
41 std::string file_contents =
"";
61 bool PrepareAsPlainText();
70 bool AppendMessageToHTML(BlamLogMessage message);
79 bool AppendMessageToPlainText(BlamLogMessage message);
143 bool stylized_html_logs =
false;
144 bool log_ready =
false;
146 std::vector<BlamReportFile*> log_files = std::vector<BlamReportFile*>();
158 BlamReport(BlamReportType type, std::string filename);
172 bool LogEvent(BlamLogMessage message);
324 BLAM void LogEvent(std::string message,
bool show_timestamp);
332 BLAM void LogEvent(std::string message, BlamReportType report_type);
341 BLAM void LogEvent(std::string message,
bool show_timestamp, BlamLogLevel severity);
353 BLAM void LogEvent(std::string message,
bool show_timestamp, BlamLogLevel severity,
short r,
short g,
short b);
361 BLAM void LogEvent(std::string message, BlamLogLevel severity);
370 BLAM void LogEvent(std::string message, BlamLogLevel severity, BlamReportType report_type);
379 BLAM void LogEvent(std::string message, BlamLogLevel severity, BlamLogVisibility visibility);
387 BLAM void LogEvent(std::string message, BlamColor color);
396 BLAM void LogEvent(std::string message, BlamColor color, BlamLogVisibility visibility);
435 BLAM void LogEventForce(std::string message, BlamLogLevel severity, BlamLogVisibility visibility);
444 BLAM void LogEventForce(std::string message, BlamLogLevel severity, BlamReportType report_type);
@ Default
Indicates the build string should use the default format.
BlamLogFileFormat
Enumerator containing possible log file formats.
Definition: logger.h:21
BlamReportFile(BlamLogFileFormat file_format, std::string base_dir, BlamReport *_report)
Creates a new BlamReportFile.
Definition: BlamReportFile.cpp:11
BlamLogMessage apply_message_log_level_data(BlamLogMessage message)
Definition: aliases.cpp:51
#define ENGINE_CFG_SECTION(section_name)
Macro to quickly access a configuration section from the engine configuration file.
Definition: config.h:29
@ Reports
Directory used to store the latest report (log) files. Defaults to {DataRoot}/reports/.
@ HTML
The log file will be written with an HTML format.
BLAM void AddMessage(BlamLogMessage message)
Adds a message to the queue.
Definition: queue.cpp:70
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:142
#define BLAM_VS_DATE_FRIENDLY
Definition: version_data.h:20
BlamExceptionType GetType()
Retrieves the type of the exception.
Definition: BlamException.cpp:14
Class representing a report file.
Definition: logger.h:140
BLAM BlamColor GetLogLevelColor(BlamLogLevel log_level)
Retrieves the BlamColor that a specific log level should display with.
Definition: aliases.cpp:12
void Flush()
Flushes the contents of each report file to disk.
Definition: BlamReport.cpp:184
bool use_reports
Whether or not logs are being written to multiple report files.
Definition: queue.cpp:23
@ TextLog
Indicates the build string should be formatted for plain text log files.
date New version
Definition: chiropteraDM.txt:50
BLAM std::string ApplyPlaceholders(std::string string)
Replaces any and all placeholder tags in the specified string with their evaulated values.
Definition: placeholders.cpp:22
#define DEFAULT_LOG_FILENAME
Specifies the default filename of a log file, without the extension.
Definition: logger.h:10
BLAM ConfigFile * GetConfig()
Retrieves the engine configuration file.
Definition: compat.cpp:5
BlamArithmeticErrorException(std::string _message)
Constructs a new arithmetic error exception.
Definition: BlamArithmeticErrorException.cpp:3
BLAM void StopFlushThread()
Definition: queue.cpp:217
Namespace containing things relating to the Render Stack.
Definition: drawing.h:14
#define USER_DATA_PATH(path)
Macro to quickly access a user data folder.
Definition: config.h:43
@ PlainText
The log file will be written in a plain text (.txt) format.
Class representing a report file.
Definition: logger.h:33
BlamAccessViolationException(std::string _message)
Constructs a new access violation exception.
Definition: BlamAccessViolationException.cpp:3
@ Both
The log file will be written as both an HTML document and a plain text document.
@ LogArchives
Directory used to store previous log archives. Defaults to {DataRoot}/logs/.
BLAM BlamConfigurationFile * GetConfiguration(std::string filename)
Definition: config.cpp:70
BLAM std::vector< BlamLogMessage > * GetQueue()
Retrieves the current message queue.
Definition: queue.cpp:187
void PrintStartupHeader()
Prints the startup header to the log.
Definition: BlamReport.cpp:103
BlamException(BlamExceptionType _type, std::string _message)
Constructs a new Blamite exception.
Definition: BlamException.cpp:3
void handleNewOutput(BlamLogMessage message)
Definition: console.hpp:346
BLAM std::string GetLogLevelCSSClass(BlamLogLevel log_level)
Gets the CSS class name for the specified log level.
Definition: logger.cpp:192
BLAM BlamColor * GetGlobalAsColor(std::string name)
Retrieves a global's value as a BlamColor.
Definition: globals.cpp:419
BLAM BlamResult LoadConfiguration(std::string filename)
Definition: config.cpp:16
BLAM std::string GetVersionBuildString(BlamVersionStringDisplayMode display_mode)
Retrieves the build string of the engine.
Definition: engine_definitions.cpp:53
bool AppendMessage(BlamLogMessage message)
Appends a message to the log file.
Definition: BlamReportFile.cpp:264
BlamExceptionType
Enumerator listing all possible Blamite exceptions.
Definition: exception.h:12
std::vector< BlamReport * > reports
List of all reports.
Definition: logger.cpp:15
void MarkAsReady()
Marks the report as ready for use.
Definition: BlamReport.cpp:179
#define ENGINE_VERSION
Definition: version_data.h:31
BLAM bool StringExists(std::string id)
Looks through the list of loaded engine strings to see if a given string has been loaded.
Definition: engine_text.cpp:70
#define ENGINE_CFG
Macro to allow quicker access to the main configuration file.
Definition: config.h:22
#define ENGINE_DATA_PATH(path)
Macro to quickly access a game engine data folder.
Definition: config.h:36
void LoadConsoleColors()
Loads console color configuration.
Definition: logger.cpp:20
bool PrepareFile()
Prepares the log file for writing.
Definition: BlamReportFile.cpp:238
std::string GetExceptionMessage()
Retrieves the message describing the exception.
Definition: BlamException.cpp:19
#define BLAM_VS_PROJECT_NAME
Definition: version_data.h:26
std::string report_filename
The filename of this report, without the extension.
Definition: logger.h:149
bool LogEvent(BlamLogMessage message)
Writes a message to the log file, console, and/or STDOUT depending on the message.
Definition: BlamReport.cpp:77
@ AccessViolation
A file or memory access violation. Fired when a SIGSEGV signal is received.
BLAM void Flush()
Flushes the queue, causing all messages to be written to all places they are configured to do so.
Definition: queue.cpp:38
BlamIllegalInstructionException(std::string _message)
Constructs a new illegal instruction exception.
Definition: BlamIllegalInstructionException.cpp:3
bool IsReady()
Whether or not the report is ready for use.
Definition: BlamReport.cpp:174
@ DefaultConfigs
Directory containing default configuration files. Defaults to ./content/blam/default_configs/
sock planetquake com All rights reserved Quake III Arena is a registered trademark of id Inc This level may be electronically distributed only at NO CHARGE to the recipient in its current MUST include this txt file
Definition: chiropteraDM.txt:95
BLAM void Shutdown()
Flushes the queue and may later be used to perform other shutdown tasks.
Definition: queue.cpp:32
BlamReportType report_type
The type of this report.
Definition: logger.h:150
#define BLAM
Definition: logger.h:13
@ ArithmeticError
An arithmetic error, such as a divide by zero error. Fired when a SIGFPE signal is received.
@ IllegalInstruction
An illegal instruction error. Fired when a SIGILL signal is received.
BLAM void StartFlushThread()
Definition: queue.cpp:212
#define ENGINE_TEXT(string_id)
Definition: engine_text.h:7
#define CONFIG_COLOR_NAME
The filename of the default console color configuration.
Definition: config.h:15
BLAM std::vector< BlamReport * > GetReports()
Retrieves the list of reports.
Definition: logger.cpp:209
BLAM void Shutdown()
Shuts down the logger.
Definition: logger.cpp:166
void Flush()
Flushes current report contents to disk.
Definition: BlamReportFile.cpp:281
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:274
void Initialize()
Initializes the report to ensure it is ready for use.
Definition: BlamReport.cpp:18
~BlamReportFile()
Definition: BlamReportFile.cpp:86
BlamReport(BlamReportType type, std::string filename)
Initializes a new BlamReport.
Definition: BlamReport.cpp:12
@ DataRoot
The root of all user data. Defaults to BlamStrings::Utils::IO::GetEngineDataRoot().
BLAM void LogEventAsync(std::string message)
Logs a message to the log and/or console asynchronously.
Definition: aliases.cpp:112
void CreateReportViewerPage()
Prepares the HTML file for the BlamReport Viewer.
Definition: logger.cpp:78
@ Gallery
Directory containing general-purpose images. Defaults to ./content/Gallery/
Namespace containing things related to the Blamite Logger.
Definition: logger.h:200
@ Content
Directory containing general-purpose resources. Defaults to ./content/
BLAM void FlushThread()
Definition: queue.cpp:196
#define BLAM_VS_TIME_FRIENDLY
Definition: version_data.h:21
BLAM void Initialize()
Initializes the logger queue.
Definition: queue.cpp:25
BLAM void Initialize()
Prepares the logger for use.
Definition: logger.cpp:130
BLAM StackObjectBase * GetStackItem(std::string id)
Retrieves an item from the render stack.
Definition: render_stack.cpp:75
BLAM BlamReport * GetReport(BlamReportType type)
Retrieves report data with the specified type.
Definition: logger.cpp:179
BLAM GvarUpdateResult UpdateGlobal(std::string name, std::string new_value)
Updates the value of a String global.
Definition: globals.cpp:578
Definition: console.hpp:66
Class representing a custom Blamite exception.
Definition: exception.h:26