Blamite Game Engine - blam!  00296.01.12.21.0102.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...
 
HRESULT WriteLineToFile (BlamLogMessage message)
 Writes a line to the report's log file(s). More...
 
int 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
 
BlamReportType report_type
 

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 
)
inline

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.

Todo:
Implement something to handle the configured log type not being valid

◆ IsReady()

bool BlamReport::IsReady ( )

Whether or not the report is ready for use.

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

◆ LogEvent()

int 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.

◆ MarkAsReady()

void BlamReport::MarkAsReady ( )

Marks the report as ready for use.

◆ PrintStartupHeader()

void BlamReport::PrintStartupHeader ( )

Prints the startup header to the log.

◆ WriteLineToFile()

HRESULT BlamReport::WriteLineToFile ( BlamLogMessage  message)

Writes a line to the report's log file(s).

Parameters
message- The message to add to the log file.
Returns
S_OK if the message was written without error, otherwise returns E_FAIL.

Member Data Documentation

◆ report_filename

std::string BlamReport::report_filename

◆ report_type

BlamReportType BlamReport::report_type

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