Blamite Game Engine - blam!  00272.10.26.20.0001.blamite
The core library for the Blamite Game Engine.
logger.h File Reference
#include <Windows.h>
#include <vector>
#include "components/resources/engine_globals/globals.h"

Go to the source code of this file.

Classes

struct  Blam::Logger::LogMessage
 Structure to store log message data. More...
 
class  Blam::Logger::Report
 Class representing a report file. More...
 

Namespaces

 Blam
 Namespace surrounding all major engine components.
 
 Blam::Logger
 Namespace containing things related to the Blamite Logger.
 
 Blam::Logger::Internal
 Internal functions used by the logger.
 
 Blam::Logger::Queue
 Things relating to the logger's message Queue.
 

Macros

#define DEFAULT_LOG_FILENAME   "debug"
 Specifies the default filename of a log file, without the extension. More...
 
#define BLAM
 
#define WSV_NONE   LogSeverity::None
 Macro for 'None' log seveirty. Original pre-enum value was 0. More...
 
#define WSV_INFO   LogSeverity::Info
 Macro for 'Info' log seveirty. Original pre-enum value was 1. More...
 
#define WSV_ERROR   LogSeverity::Error
 Macro for 'Error' log seveirty. Original pre-enum value was 2. More...
 
#define WSV_WARNING   LogSeverity::Warning
 Macro for 'Warning' log seveirty. Original pre-enum value was 3. More...
 
#define WSV_SEVERE   LogSeverity::Severe
 Macro for 'Severe' log seveirty. Original pre-enum value was 4. More...
 
#define WSV_CRITICAL   LogSeverity::Critical
 Macro for 'Critical' log seveirty. Original pre-enum value was 5. More...
 
#define WSV_AIERR   LogSeverity::AiError
 Macro for 'AiError' log seveirty. Original pre-enum value was 6. More...
 
#define WVIS_NONE   LogVisibility::Vis_None
 Macro for 'Vis_None' log visibility. Original pre-enum value was -1. More...
 
#define WVIS_ALL   LogVisibility::All
 Macro for 'All' log visibility. Original pre-enum value was 0. More...
 
#define WVIS_STDOUT_ONLY   LogVisibility::StdoutOnly
 Macro for 'StdoutOnly' log visibility. Original pre-enum value was 1. More...
 
#define WVIS_FILE_ONLY   LogVisibility::FileOnly
 Macro for 'FileOnly' log visibility. Original pre-enum value was 2. More...
 
#define WVIS_HTML_ONLY   LogVisibility::HTMLOnly
 Macro for 'HTMLOnly' log visibility. Original pre-enum value was 3. More...
 
#define WVIS_TXT_ONLY   LogVisibility::TXTOnly
 Macro for 'TXTOnly' log visibility. Original pre-enum value was 4. More...
 
#define MAX_ERRORS_BEFORE_SUPRESSION   5
 Controls the maximum amount of error messages shown before they are suppressed from the in-game console. More...
 
#define BL_LOGEVT(m)   Blam::Logger::LogEvent(m);
 Macro for logging a message to console. More...
 
#define BL_LOGEVT_ST(m, st)   Blam::Logger::LogEvent(m, st);
 Macro for logging a message to console. More...
 
#define BL_LOGEVT_SEV(m, st, sev)   Blam::Logger::LogEvent(m, st, sev);
 Macro for logging a message to console. More...
 
#define BL_LOGEVT_RGB(m, st, sev, r, g, b)   Blam::Logger::LogEvent(m, st, sev, r, g, b);
 Macro for logging a message to console. More...
 

Enumerations

enum  LogSeverity {
  None, Info, Error, Warning,
  Severe, Critical, AiError
}
 Enumerator to specify log event severity. More...
 
enum  LogVisibility {
  Vis_None, All, StdoutOnly, FileOnly,
  HTMLOnly, TXTOnly
}
 Enumerator to specify log event visibility. More...
 
enum  ReportType { Debug, DebugFull, TagDebug, UIDebug }
 Enumerator containing possible report types. More...
 

Functions

BLAM void Blam::Logger::Internal::PrepareTextLog (std::string report_filename)
 Prepares the plain text log file for writing. More...
 
BLAM void Blam::Logger::Internal::PrepareHTMLLog (std::string report_filename)
 Prepares the HTML log file. More...
 
BLAM std::string Blam::Logger::Internal::PrepareHTMLTemplate (std::string log_title)
 Prepares the contents of the default HTML log template. More...
 
BLAM void Blam::Logger::Internal::CreateReportViewerPage ()
 Prepares the HTML file for the Report Viewer. More...
 
BLAM void Blam::Logger::Internal::LoadConsoleColors ()
 Loads console color configuration. More...
 
BLAM void Blam::Logger::Queue::Flush ()
 Flushes the queue, causing all messages to be written to all places they are configured to do so. More...
 
BLAM void Blam::Logger::Queue::AddMessage (Blam::Logger::LogMessage message)
 Adds a message to the queue. More...
 
BLAM std::vector< Blam::Logger::LogMessage > * Blam::Logger::Queue::GetQueue ()
 Retrieves the current message queue. More...
 
BLAM void Blam::Logger::SetLoggerReady ()
 Marks all reports as ready for use. More...
 
BLAM Report * Blam::Logger::GetReport (ReportType type)
 Retrieves report data with the specified type. More...
 
BLAM std::string Blam::Logger::GetSeverityCSSClass (LogSeverity severity)
 Gets the CSS class name for the specified severity. More...
 
BLAM void Blam::Logger::PrepareLogger ()
 Prepares the logger for use. More...
 
BLAM void Blam::Logger::LogEventAsync (std::string message)
 Logs a message to the log and/or console asynchronously. More...
 
BLAM void Blam::Logger::LogEvent (std::string message)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, bool show_timestamp)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, ReportType report_type)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, bool show_timestamp, LogSeverity severity)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, bool show_timestamp, LogSeverity severity, short r, short g, short b)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, LogSeverity severity)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, LogSeverity severity, ReportType report_type)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, LogSeverity severity, LogVisibility visibility)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (std::string message, BlamColor color)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEvent (Blam::Logger::LogMessage message)
 Logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEventForce (std::string message, LogSeverity severity)
 Forcibly logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEventForce (std::string message, BlamColor color)
 Forcibly logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEventForce (std::string message, LogSeverity severity, LogVisibility visibility)
 Forcibly logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEventForce (std::string message, LogSeverity severity, ReportType report_type)
 Forcibly logs a message to the log and/or console. More...
 
BLAM void Blam::Logger::LogEventForce (Blam::Logger::LogMessage message)
 Forcibly logs a message to the log and/or console. More...
 

Macro Definition Documentation

◆ BL_LOGEVT

#define BL_LOGEVT (   m)    Blam::Logger::LogEvent(m);

Macro for logging a message to console.

◆ BL_LOGEVT_RGB

#define BL_LOGEVT_RGB (   m,
  st,
  sev,
  r,
  g,
 
)    Blam::Logger::LogEvent(m, st, sev, r, g, b);

Macro for logging a message to console.

◆ BL_LOGEVT_SEV

#define BL_LOGEVT_SEV (   m,
  st,
  sev 
)    Blam::Logger::LogEvent(m, st, sev);

Macro for logging a message to console.

◆ BL_LOGEVT_ST

#define BL_LOGEVT_ST (   m,
  st 
)    Blam::Logger::LogEvent(m, st);

Macro for logging a message to console.

◆ BLAM

#define BLAM

◆ DEFAULT_LOG_FILENAME

#define DEFAULT_LOG_FILENAME   "debug"

Specifies the default filename of a log file, without the extension.

◆ MAX_ERRORS_BEFORE_SUPRESSION

#define MAX_ERRORS_BEFORE_SUPRESSION   5

Controls the maximum amount of error messages shown before they are suppressed from the in-game console.

◆ WSV_AIERR

#define WSV_AIERR   LogSeverity::AiError

Macro for 'AiError' log seveirty. Original pre-enum value was 6.

◆ WSV_CRITICAL

#define WSV_CRITICAL   LogSeverity::Critical

Macro for 'Critical' log seveirty. Original pre-enum value was 5.

◆ WSV_ERROR

#define WSV_ERROR   LogSeverity::Error

Macro for 'Error' log seveirty. Original pre-enum value was 2.

◆ WSV_INFO

#define WSV_INFO   LogSeverity::Info

Macro for 'Info' log seveirty. Original pre-enum value was 1.

◆ WSV_NONE

#define WSV_NONE   LogSeverity::None

Macro for 'None' log seveirty. Original pre-enum value was 0.

◆ WSV_SEVERE

#define WSV_SEVERE   LogSeverity::Severe

Macro for 'Severe' log seveirty. Original pre-enum value was 4.

◆ WSV_WARNING

#define WSV_WARNING   LogSeverity::Warning

Macro for 'Warning' log seveirty. Original pre-enum value was 3.

◆ WVIS_ALL

#define WVIS_ALL   LogVisibility::All

Macro for 'All' log visibility. Original pre-enum value was 0.

◆ WVIS_FILE_ONLY

#define WVIS_FILE_ONLY   LogVisibility::FileOnly

Macro for 'FileOnly' log visibility. Original pre-enum value was 2.

◆ WVIS_HTML_ONLY

#define WVIS_HTML_ONLY   LogVisibility::HTMLOnly

Macro for 'HTMLOnly' log visibility. Original pre-enum value was 3.

◆ WVIS_NONE

#define WVIS_NONE   LogVisibility::Vis_None

Macro for 'Vis_None' log visibility. Original pre-enum value was -1.

◆ WVIS_STDOUT_ONLY

#define WVIS_STDOUT_ONLY   LogVisibility::StdoutOnly

Macro for 'StdoutOnly' log visibility. Original pre-enum value was 1.

◆ WVIS_TXT_ONLY

#define WVIS_TXT_ONLY   LogVisibility::TXTOnly

Macro for 'TXTOnly' log visibility. Original pre-enum value was 4.

Enumeration Type Documentation

◆ LogSeverity

Enumerator to specify log event severity.

Enumerator
None 

Indicates no severity, and is displayed with no formatting.

Info 

Indicates an informative message. Mostly redundant due to the None option.

Error 

Indicates an error that could cause engine instability.

Warning 

Indicates a warning message. Not something critical, but something that could cause unexpected behavior.

Severe 

Indicates a severe error that the engine most likely cannot recover from.

Critical 

Indicates a critical error that the engine cannot recover from.

AiError 

Placeholder for the future, indicates an error with AI.

◆ LogVisibility

Enumerator to specify log event visibility.

Enumerator
Vis_None 

The message will not be visible anywhere.

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.

FileOnly 

The message will only be written to the log file.

HTMLOnly 

The message will only be written to the log file, if the file is in HTML format.

TXTOnly 

The message will only be written to the log file, if the file is in plain text format.

◆ ReportType

enum ReportType

Enumerator containing possible report types.

Enumerator
Debug 

Default report file. Contains all log messages found in other reports, excluding debug_full.

DebugFull 

Similar to debug, but includes additional messages that would be hidden from debug.

TagDebug 

Report file for all tag related messages.

UIDebug 

Report file for all UI messages.