 |
Blamite Game Engine - blam!
00272.10.26.20.0001.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file.
8 #define DEFAULT_LOG_FILENAME "debug"
15 #define WSV_NONE LogSeverity::None
16 #define WSV_INFO LogSeverity::Info
17 #define WSV_ERROR LogSeverity::Error
18 #define WSV_WARNING LogSeverity::Warning
19 #define WSV_SEVERE LogSeverity::Severe
20 #define WSV_CRITICAL LogSeverity::Critical
21 #define WSV_AIERR LogSeverity::AiError
24 #define WVIS_NONE LogVisibility::Vis_None
25 #define WVIS_ALL LogVisibility::All
26 #define WVIS_STDOUT_ONLY LogVisibility::StdoutOnly
27 #define WVIS_FILE_ONLY LogVisibility::FileOnly
28 #define WVIS_HTML_ONLY LogVisibility::HTMLOnly
29 #define WVIS_TXT_ONLY LogVisibility::TXTOnly
31 #define MAX_ERRORS_BEFORE_SUPRESSION 5
34 #define BL_LOGEVT(m) Blam::Logger::LogEvent(m);
35 #define BL_LOGEVT_ST(m, st) Blam::Logger::LogEvent(m, st);
36 #define BL_LOGEVT_SEV(m, st, sev) Blam::Logger::LogEvent(m, st, sev);
37 #define BL_LOGEVT_RGB(m, st, sev, r, g, b) Blam::Logger::LogEvent(m, st, sev, r, g, b);
118 bool log_ready =
false;
119 std::string timestamped_log_path;
328 BLAM void LogEvent(std::string message,
bool show_timestamp);
Namespace surrounding all major engine components.
Definition: blam_api.h:18
@ FileOnly
The message will only be written to the log file.
Definition: logger.h:61
@ Error
Indicates an error that could cause engine instability.
Definition: logger.h:46
@ None
Indicates no severity, and is displayed with no formatting.
Definition: logger.h:44
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:33
Class representing a report file.
Definition: logger.h:115
ReportType report_type
The report that the message is intended for.
Definition: logger.h:89
@ Severe
Indicates a severe error that the engine most likely cannot recover from.
Definition: logger.h:48
LogVisibility
Enumerator to specify log event visibility.
Definition: logger.h:56
@ TXTOnly
The message will only be written to the log file, if the file is in plain text format.
Definition: logger.h:63
BLAM void PrepareLogger()
Prepares the logger for use.
Definition: logger.cpp:16
int LogEvent(Blam::Logger::LogMessage message)
Writes a message to the log file, console, and/or STDOUT depending on the message.
Definition: report.cpp:98
LogSeverity severity
The message severity. Defaults to None.
Definition: logger.h:93
Structure to store log message data.
Definition: logger.h:87
@ AiError
Placeholder for the future, indicates an error with AI.
Definition: logger.h:50
std::string report_filename
Definition: logger.h:142
BLAM std::vector< Blam::Logger::LogMessage > * GetQueue()
Retrieves the current message queue.
Definition: queue.cpp:169
BLAM void PrepareTextLog(std::string report_filename)
Prepares the plain text log file for writing.
Definition: logger.cpp:115
LogVisibility visibility
The visibility of the log message.
Definition: logger.h:99
HRESULT WriteLineToFile(Blam::Logger::LogMessage message)
Writes a line to the report's log file(s).
Definition: file_logging.cpp:11
Report(ReportType type, std::string filename)
Initializes a new Report.
Definition: logger.h:151
ReportType report_type
Definition: logger.h:143
bool show_timestamp
Whether or not to show the timestamp of the message in the log file.
Definition: logger.h:94
void MarkAsReady()
Marks the report as ready for use.
Definition: report.cpp:229
@ DebugFull
Similar to debug, but includes additional messages that would be hidden from debug.
Definition: logger.h:72
@ Critical
Indicates a critical error that the engine cannot recover from.
Definition: logger.h:49
@ UIDebug
Report file for all UI messages.
Definition: logger.h:74
BLAM void LoadConsoleColors()
Loads console color configuration.
Definition: logger.cpp:221
@ All
The message will be shown in all places where log output can be written.
Definition: logger.h:59
ReportType
Enumerator containing possible report types.
Definition: logger.h:69
BlamColor color
The overridden color information. Overrules any severity-based coloring.
Definition: logger.h:97
Definition: socket.cpp:16
#define WSV_NONE
Macro for 'None' log seveirty. Original pre-enum value was 0.
Definition: logger.h:15
bool override_color
Whether or not to override the message color.
Definition: logger.h:96
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
BLAM void AddMessage(Blam::Logger::LogMessage message)
Adds a message to the queue.
Definition: queue.cpp:46
@ Warning
Indicates a warning message. Not something critical, but something that could cause unexpected behavi...
Definition: logger.h:47
#define BLAM
Definition: logger.h:11
BLAM void SetLoggerReady()
Marks all reports as ready for use.
Definition: logger.cpp:213
@ Vis_None
The message will not be visible anywhere.
Definition: logger.h:58
@ StdoutOnly
The message will only be shown to the in-game console and STDOUT.
Definition: logger.h:60
@ TagDebug
Report file for all tag related messages.
Definition: logger.h:73
void Initialize()
Initializes the report to ensure it is ready for use.
Definition: report.cpp:14
BLAM void LogEventForce(std::string message, LogSeverity severity)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:150
#define WVIS_ALL
Macro for 'All' log visibility. Original pre-enum value was 0.
Definition: logger.h:25
bool IsReady()
Whether or not the report is ready for use.
Definition: report.cpp:224
BLAM void CreateReportViewerPage()
Prepares the HTML file for the Report Viewer.
Definition: logger.cpp:136
BLAM void PrepareHTMLLog(std::string report_filename)
Prepares the HTML log file.
Definition: logger.cpp:52
@ Info
Indicates an informative message. Mostly redundant due to the None option.
Definition: logger.h:45
BLAM Report * GetReport(ReportType type)
Retrieves report data with the specified type.
Definition: logger.cpp:39
BLAM std::string PrepareHTMLTemplate(std::string log_title)
Prepares the contents of the default HTML log template.
Definition: logger.cpp:83
std::string timestamp
The timestamp of the log message.
Definition: logger.h:91
BLAM void LogEventAsync(std::string message)
Logs a message to the log and/or console asynchronously.
Definition: aliases.cpp:8
void PrintStartupHeader()
Prints the startup header to the log.
Definition: report.cpp:153
std::string message
The message contents.
Definition: logger.h:92
Structure representing a color.
Definition: globals.h:20
LogSeverity
Enumerator to specify log event severity.
Definition: logger.h:42
@ Debug
Default report file. Contains all log messages found in other reports, excluding debug_full.
Definition: logger.h:71
bool override_duplicate_limit
Whether or not this message should ignore the duplicate message limit.
Definition: logger.h:101
@ HTMLOnly
The message will only be written to the log file, if the file is in HTML format.
Definition: logger.h:62
BLAM std::string GetSeverityCSSClass(LogSeverity severity)
Gets the CSS class name for the specified severity.
Definition: logger.cpp:190