Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
jop::DebugHandler Class Reference

#include <DebugHandler.hpp>

Public Types

enum  Severity {
  Severity::Error, Severity::Warning, Severity::Info, Severity::Diagnostic,
  Severity::__Always
}
 

Public Member Functions

bool isConsoleEnabled ()
 Check if the console is enabled. More...
 
void setEnabled (const bool enabled)
 Enable/disable the console. More...
 
void setVerbosity (const Severity severity)
 Set the verbosity level. More...
 
Severity getSeverity () const
 Get the verbosity level. More...
 
void setReduceSpam (const bool set)
 Set the reduce spam flag. More...
 
void setDebuggerOutput (const bool set)
 Set debugger logger attachment. More...
 
void setFileLogging (const bool set)
 Enable/disable file logging. More...
 
bool fileLoggingEnabled () const
 Check if file logging is enabled. More...
 
std::recursive_mutex & getMutex ()
 Get the debug handler mutex. More...
 
DebugHandleroperator<< (const Severity severity)
 Operator for setting the severity level for the next output string. More...
 
DebugHandleroperator<< (std::basic_ostream< char, std::char_traits< char >> &(*)(std::basic_ostream< char, std::char_traits< char >> &))
 Flushes the stream using std::endl. More...
 
template<typename T >
DebugHandleroperator<< (const T &data)
 An operator for inputting data into the stream. More...
 

Static Public Member Functions

static DebugHandlergetInstance ()
 Get the DebugHandler instance. More...
 

Detailed Description

Definition at line 88 of file DebugHandler.hpp.

Member Enumeration Documentation

The severity levels

Enumerator
Error 

Error severity (0)

Warning 

Warning severity (1)

Info 

Info severity (2)

Diagnostic 

Diagnostic severity (3)

__Always 

For internal functionality, do not use.

Definition at line 100 of file DebugHandler.hpp.

Member Function Documentation

bool jop::DebugHandler::fileLoggingEnabled ( ) const

Check if file logging is enabled.

Returns
True if enabled
static DebugHandler& jop::DebugHandler::getInstance ( )
static

Get the DebugHandler instance.

Returns
Reference to the instance
std::recursive_mutex& jop::DebugHandler::getMutex ( )

Get the debug handler mutex.

You need to use this only if you're not using the pre-defined debug macros.

Returns
Reference to the internal mutex
Severity jop::DebugHandler::getSeverity ( ) const

Get the verbosity level.

Returns
The verbosity level
bool jop::DebugHandler::isConsoleEnabled ( )

Check if the console is enabled.

Returns
True if console is enabled
DebugHandler& jop::DebugHandler::operator<< ( const Severity  severity)

Operator for setting the severity level for the next output string.

Parameters
severityThe severity level
Returns
Reference to self
DebugHandler& jop::DebugHandler::operator<< ( std::basic_ostream< char, std::char_traits< char >> &  *)(std::basic_ostream< char, std::char_traits< char >> &)

Flushes the stream using std::endl.

Returns
Reference to self
template<typename T >
DebugHandler& jop::DebugHandler::operator<< ( const T &  data)

An operator for inputting data into the stream.

Parameters
dataThe data to be inserted
Returns
Reference to self
void jop::DebugHandler::setDebuggerOutput ( const bool  set)

Set debugger logger attachment.

When debugger output is enabled, all debug messages will be forwarded to the debugger console, e.g. the Visual Studio output window.

Parameters
setTrue to enable debugger output
void jop::DebugHandler::setEnabled ( const bool  enabled)

Enable/disable the console.

Parameters
enabledTrue to enable
void jop::DebugHandler::setFileLogging ( const bool  set)

Enable/disable file logging.

When file logging is enabled, text files will be created for all severity levels separately in the user directory.

Parameters
setTrue to enable
void jop::DebugHandler::setReduceSpam ( const bool  set)

Set the reduce spam flag.

Parameters
setTrue to enable
void jop::DebugHandler::setVerbosity ( const Severity  severity)

Set the verbosity level.

Parameters
severityThe verbosity to set

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