Blamite Game Engine - Blam (Core)
Blam::Logger::Report Class Reference

Class representing a report file. More...

#include <logger.h>

Public Member Functions

 Report (ReportType type, std::string filename)
 Initializes a new Report. More...
 
void Initialize ()
 Initializes the report to ensure it is ready for use. More...
 
HRESULT WriteLineToFile (Blam::Logger::LogMessage message)
 Writes a line to the report's log file(s). More...
 
int LogEvent (Blam::Logger::LogMessage 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
 
ReportType 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

◆ Report()

Blam::Logger::Report::Report ( ReportType  type,
std::string  filename 
)
inline

Initializes a new Report.

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

Member Function Documentation

◆ Initialize()

void Report::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 Blam::Logger::Report::IsReady ( )

Whether or not the report is ready for use.

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

◆ LogEvent()

int Blam::Logger::Report::LogEvent ( Blam::Logger::LogMessage  message)

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

Parameters
message- The message to log.

◆ MarkAsReady()

void Blam::Logger::Report::MarkAsReady ( )

Marks the report as ready for use.

◆ PrintStartupHeader()

void Blam::Logger::Report::PrintStartupHeader ( )

Prints the startup header to the log.

◆ WriteLineToFile()

HRESULT Blam::Logger::Report::WriteLineToFile ( Blam::Logger::LogMessage  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 Blam::Logger::Report::report_filename

◆ report_type

ReportType Blam::Logger::Report::report_type

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