 |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file.
5 #include <Strings/components/interface/logger/logger.h>
9 #define DEFAULT_LOG_FILENAME "debug"
16 #define WSV_NONE BlamLogLevel::None
17 #define WSV_ERROR BlamLogLevel::Error
18 #define WSV_WARNING BlamLogLevel::Warning
19 #define WSV_SEVERE BlamLogLevel::Severe
20 #define WSV_CRITICAL BlamLogLevel::Severe
27 #define WSV_INFO BlamLogLevel::Input
34 #define WSV_AIERR BlamLogLevel::AiError
37 #define WVIS_NONE BlamLogVisibility::Vis_None
38 #define WVIS_ALL BlamLogVisibility::All
39 #define WVIS_STDOUT_ONLY BlamLogVisibility::StdoutOnly
40 #define WVIS_FILE_ONLY BlamLogVisibility::FileOnly
41 #define WVIS_HTML_ONLY BlamLogVisibility::HTMLOnly
42 #define WVIS_TXT_ONLY BlamLogVisibility::TXTOnly
44 #define MAX_ERRORS_BEFORE_SUPRESSION 5
53 #define BL_LOGEVT(m) Blam::Logger::LogEvent(m);
60 #define BL_LOGEVT_ST(m, st) Blam::Logger::LogEvent(m, st);
67 #define BL_LOGEVT_SEV(m, st, sev) Blam::Logger::LogEvent(m, st, sev);
74 #define BL_LOGEVT_RGB(m, st, sev, r, g, b) Blam::Logger::LogEvent(m, st, sev, r, g, b);
135 bool log_ready =
false;
136 std::string timestamped_log_path;
146 HRESULT WriteLineToText(std::string file_path,
BlamLogMessage message);
156 HRESULT WriteLineToHTML(std::string file_path,
BlamLogMessage message);
352 BLAM void LogEvent(std::string message,
bool show_timestamp);
369 BLAM void LogEvent(std::string message,
bool show_timestamp, BlamLogLevel severity);
381 BLAM void LogEvent(std::string message,
bool show_timestamp, BlamLogLevel severity,
short r,
short g,
short b);
389 BLAM void LogEvent(std::string message, BlamLogLevel severity);
Namespace surrounding all major engine components.
Definition: blam_api.h:18
BlamReportType report_type
The report that the message is intended for.
Definition: logger.h:106
@ 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.
BLAM void AddMessage(BlamLogMessage message)
Adds a message to the queue.
Definition: queue.cpp:46
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:101
@ TagDebug
BlamReport file for all tag related messages.
Class representing a report file.
Definition: logger.h:132
@ HTMLOnly
The message will only be written to the log file, if the file is in HTML format.
BLAM void PrepareLogger()
Prepares the logger for use.
Definition: logger.cpp:16
BlamReportType
Enumerator containing possible report types.
Definition: logger.h:92
@ Vis_None
The message will not be visible anywhere.
BLAM void PrepareTextLog(std::string report_filename)
Prepares the plain text log file for writing.
Definition: logger.cpp:116
@ color
Definition: render_model.h:12
BLAM std::vector< BlamLogMessage > * GetQueue()
Retrieves the current message queue.
Definition: queue.cpp:168
void PrintStartupHeader()
Prints the startup header to the log.
Definition: report.cpp:153
BlamLogVisibility visibility
The visibility of the log message.
Definition: logger.h:116
BlamColor color
The overridden color information. Overrules any severity-based coloring.
Definition: logger.h:114
std::string message
The message contents.
Definition: logger.h:109
BLAM void LogEventForce(std::string message, BlamLogLevel severity)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:218
BLAM void LoadConsoleColors()
Loads console color configuration.
Definition: logger.cpp:220
void MarkAsReady()
Marks the report as ready for use.
Definition: report.cpp:229
bool override_color
Whether or not to override the message color.
Definition: logger.h:113
HRESULT WriteLineToFile(BlamLogMessage message)
Writes a line to the report's log file(s).
Definition: file_logging.cpp:11
@ 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.
Definition: socket.cpp:16
std::string report_filename
Definition: logger.h:159
#define WSV_NONE
Macro for 'None' log seveirty. Original pre-enum value was 0.
Definition: logger.h:16
BlamLogVisibility
Enumerator to specify log event visibility.
Definition: logger.h:79
BLAM void Flush()
Flushes the queue, causing all messages to be written to all places they are configured to do so.
Definition: queue.cpp:17
bool IsReady()
Whether or not the report is ready for use.
Definition: report.cpp:224
@ ShadersDebug
BlamReport file for shader messages.
BlamReportType report_type
Definition: logger.h:160
#define BLAM
Definition: logger.h:12
BLAM void SetLoggerReady()
Marks all reports as ready for use.
Definition: logger.cpp:212
@ 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:38
@ FileOnly
The message will only be written to the log file.
bool override_duplicate_limit
Whether or not this message should ignore the duplicate message limit.
Definition: logger.h:118
BLAM void CreateReportViewerPage()
Prepares the HTML file for the BlamReport Viewer.
Definition: logger.cpp:137
bool show_timestamp
Whether or not to show the timestamp of the message in the log file.
Definition: logger.h:111
BLAM std::string GetSeverityCSSClass(BlamLogLevel severity)
Gets the CSS class name for the specified severity.
Definition: logger.cpp:191
BLAM void PrepareHTMLLog(std::string report_filename)
Prepares the HTML log file.
Definition: logger.cpp:53
void Initialize()
Initializes the report to ensure it is ready for use.
Definition: report.cpp:14
int LogEvent(BlamLogMessage message)
Writes a message to the log file, console, and/or STDOUT depending on the message.
Definition: report.cpp:98
BLAM std::string PrepareHTMLTemplate(std::string log_title)
Prepares the contents of the default HTML log template.
Definition: logger.cpp:84
Structure to store log message data.
Definition: logger.h:104
BlamReport(BlamReportType type, std::string filename)
Initializes a new BlamReport.
Definition: logger.h:168
BLAM void LogEventAsync(std::string message)
Logs a message to the log and/or console asynchronously.
Definition: aliases.cpp:74
@ 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:108
BlamLogLevel severity
The message severity. Defaults to None.
Definition: logger.h:110
BLAM BlamReport * GetReport(BlamReportType type)
Retrieves report data with the specified type.
Definition: logger.cpp:40