 |
Blamite Game Engine - blam!
00357.06.18.22.0809.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"
19 #define WVIS_NONE BlamLogVisibility::None
20 #define WVIS_ALL BlamLogVisibility::All
21 #define WVIS_STDOUT_ONLY BlamLogVisibility::StdoutOnly
22 #define WVIS_FILE_ONLY BlamLogVisibility::FileOnly
23 #define WVIS_HTML_ONLY BlamLogVisibility::HTMLOnly
24 #define WVIS_TXT_ONLY BlamLogVisibility::TXTOnly
90 std::string file_title =
"";
91 std::string file_path =
"";
93 bool stylized_html_logs =
false;
95 std::string file_contents =
"";
105 bool PrepareAsHTML();
115 bool PrepareAsPlainText();
197 bool stylized_html_logs =
false;
198 bool log_ready =
false;
200 std::vector<BlamReportFile*> log_files = std::vector<BlamReportFile*>();
369 BLAM void LogEvent(std::string message,
bool show_timestamp);
386 BLAM void LogEvent(std::string message,
bool show_timestamp, BlamLogLevel severity);
398 BLAM void LogEvent(std::string message,
bool show_timestamp, BlamLogLevel severity,
short r,
short g,
short b);
406 BLAM void LogEvent(std::string message, BlamLogLevel severity);
432 BLAM void LogEvent(std::string message, BlamColor color);
BlamReportType report_type
The report that the message is intended for.
Definition: logger.h:66
BlamLogFileFormat
Enumerator containing possible log file formats.
Definition: logger.h:54
@ UIDebug
BlamReport file for all UI messages.
@ TXTOnly
The message will only be written to the log file, if the file is in plain text format.
BlamReportFile(BlamLogFileFormat file_format, std::string base_dir, BlamReport *_report)
Creates a new BlamReportFile.
Definition: BlamReportFile.cpp:11
@ 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:141
@ TagDebug
BlamReport file for all tag related messages.
Class representing a report file.
Definition: logger.h:194
@ HTMLOnly
The message will only be written to the log file, if the file is in HTML format.
void Flush()
Flushes the contents of each report file to disk.
Definition: BlamReport.cpp:184
BlamReportType
Enumerator containing possible report types.
Definition: logger.h:42
BLAM void StopFlushThread()
Definition: queue.cpp:217
@ PlainText
The log file will be written in a plain text (.txt) format.
Class representing a report file.
Definition: logger.h:87
@ Both
The log file will be written as both an HTML document and a plain text document.
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
BlamLogVisibility visibility
The visibility of the log message.
Definition: logger.h:76
BlamColor color
The overridden color information. Overrules any severity-based coloring.
Definition: logger.h:74
std::string message
The message contents.
Definition: logger.h:69
BLAM std::string GetLogLevelCSSClass(BlamLogLevel log_level)
Gets the CSS class name for the specified log level.
Definition: logger.cpp:177
bool AppendMessage(BlamLogMessage message)
Appends a message to the log file.
Definition: BlamReportFile.cpp:264
void MarkAsReady()
Marks the report as ready for use.
Definition: BlamReport.cpp:179
bool override_color
Whether or not to override the message color.
Definition: logger.h:73
bool PrepareFile()
Prepares the log file for writing.
Definition: BlamReportFile.cpp:238
@ All
The message will be shown in all places where log output can be written.
@ StdoutOnly
The message will only be shown to the in-game console and STDOUT.
std::string report_filename
The filename of this report, without the extension.
Definition: logger.h:203
bool LogEvent(BlamLogMessage message)
Writes a message to the log file, console, and/or STDOUT depending on the message.
Definition: BlamReport.cpp:77
BlamLogVisibility
Enumerator to specify log event visibility.
Definition: logger.h:29
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
bool IsReady()
Whether or not the report is ready for use.
Definition: BlamReport.cpp:174
BLAM void Shutdown()
Flushes the queue and may later be used to perform other shutdown tasks.
Definition: queue.cpp:32
@ ShadersDebug
BlamReport file for shader messages.
BlamReportType report_type
The type of this report.
Definition: logger.h:204
#define BLAM
Definition: logger.h:13
BLAM void StartFlushThread()
Definition: queue.cpp:212
BLAM std::vector< BlamReport * > GetReports()
Retrieves the list of reports.
Definition: logger.cpp:194
@ Debug
Default report file. Contains all log messages found in other reports, excluding debug_full.
#define WVIS_ALL
Macro for 'All' log visibility. Original pre-enum value was 0.
Definition: logger.h:20
@ FileOnly
The message will only be written to the log file.
BLAM void Shutdown()
Shuts down the logger.
Definition: logger.cpp:151
bool override_duplicate_limit
Whether or not this message should ignore the duplicate message limit.
Definition: logger.h:78
void Flush()
Flushes current report contents to disk.
Definition: BlamReportFile.cpp:281
bool show_timestamp
Whether or not to show the timestamp of the message in the log file.
Definition: logger.h:71
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:258
void Initialize()
Initializes the report to ensure it is ready for use.
Definition: BlamReport.cpp:18
Structure to store log message data.
Definition: logger.h:64
~BlamReportFile()
Definition: BlamReportFile.cpp:86
BlamReport(BlamReportType type, std::string filename)
Initializes a new BlamReport.
Definition: BlamReport.cpp:12
BLAM void LogEventAsync(std::string message)
Logs a message to the log and/or console asynchronously.
Definition: aliases.cpp:111
@ DebugFull
Similar to debug, but includes additional messages that would be hidden from debug.
std::string timestamp
The timestamp of the log message.
Definition: logger.h:68
Namespace containing things related to the Blamite Logger.
Definition: logger.h:254
BLAM void FlushThread()
Definition: queue.cpp:196
BLAM void Initialize()
Initializes the logger queue.
Definition: queue.cpp:25
BLAM void Initialize()
Prepares the logger for use.
Definition: logger.cpp:115
BlamLogLevel severity
The message severity. Defaults to None.
Definition: logger.h:70
BLAM BlamReport * GetReport(BlamReportType type)
Retrieves report data with the specified type.
Definition: logger.cpp:164