Elaztek Developer Hub
Blamite Game Engine - blam!  00346.12.11.21.0529.blamite
The core library for the Blamite Game Engine.
BlamReport Class Reference

Class representing a report file. More...

#include <logger.h>

Public Member Functions

 BlamReport (BlamReportType type, std::string filename)
 Initializes a new BlamReport. More...
 
void Initialize ()
 Initializes the report to ensure it is ready for use. More...
 
bool LogEvent (BlamLogMessage message)
 Writes a message to the log file, console, and/or STDOUT depending on the message. More...
 
void PrintStartupHeader ()
 Prints the startup header to the log. More...
 
bool IsReady ()
 Whether or not the report is ready for use. More...
 
void MarkAsReady ()
 Marks the report as ready for use. More...
 

Public Attributes

std::string report_filename = "debug"
 The filename of this report, without the extension. More...
 
BlamReportType report_type = BlamReportType::Debug
 The type of this report. More...
 

Detailed Description

Class representing a report file.

Reports are used to help ensure that logs can be more easily explored. While the default report file (debug.html/debug.txt) will contain all logged messages, those messages will often also be written to a secondary, more specific file. For instance, any script messages would be written to hs_log, any tag-related messages would be written to tag_debug, and so on.

The default 'Debug' report will always be created and acts as the default log file, regardless of if reports are disabled in the config or not.

Constructor & Destructor Documentation

◆ BlamReport()

BlamReport::BlamReport ( BlamReportType  type,
std::string  filename 
)

Initializes a new BlamReport.

Parameters
type- The type of report. Must be unique.
filename- The filename for the report, without any file extensions.

Member Function Documentation

◆ Initialize()

void BlamReport::Initialize ( )

Initializes the report to ensure it is ready for use.

◆ IsReady()

bool BlamReport::IsReady ( )

Whether or not the report is ready for use.

Returns
true if the logger is ready, otherwise returns false.

◆ LogEvent()

bool BlamReport::LogEvent ( BlamLogMessage  message)

Writes a message to the log file, console, and/or STDOUT depending on the message.

Parameters
message- The message to log.
Returns
true if the message was successfully logged, otherwise returns false.

◆ MarkAsReady()

void BlamReport::MarkAsReady ( )

Marks the report as ready for use.

◆ PrintStartupHeader()

void BlamReport::PrintStartupHeader ( )

Prints the startup header to the log.

Member Data Documentation

◆ report_filename

std::string BlamReport::report_filename = "debug"

The filename of this report, without the extension.

◆ report_type

BlamReportType BlamReport::report_type = BlamReportType::Debug

The type of this report.


The documentation for this class was generated from the following files: