Pcannon Debug 1.0.0-build
Simple yet powerful debug manager for C++
|
#include <Debug.hpp>
Public Member Functions | |
Debug (const std::string &_id, const pd::DebugSettings &_settings) | |
Construct the debugger with specified ID and settings Call the inner __init() function to Initialize. | |
~Debug () | |
Call the pd::Debug::close() function to free all allocated memory. | |
bool | close () |
Free all the allocated memory and resources, return true if it succeeded, return false if it did not. | |
std::pair< bool, std::string > | constructInfo () |
Construct debug information You can use it if it failed to construct properly to get the error message. | |
std::fstream * | getFile () const |
Get file for more control over the processing and for more actions. | |
std::string | getID () const |
Return the ID of the created Debug object. | |
DebugSettings | getSettings () const |
Get the settings set for the created Debug object. | |
std::string | log (const std::string &_type, const std::string &_msg, unsigned int _level=0) |
Log the message with specific custom type, message and log level. |
Private Member Functions | |
bool | __init () |
Initialize the Debug object that is going (or was) to be constructed. |
Private Attributes | |
bool | constructed |
std::string | constructError |
std::fstream * | file |
std::string | id |
const DebugSettings | settings |
pd::Debug::Debug | ( | const std::string & | _id, |
const pd::DebugSettings & | _settings ) |
Construct the debugger with specified ID and settings Call the inner __init() function to Initialize.
_id | Set the ID of this object |
_settings | Set the settings of this object |
Definition at line 42 of file Debug.cpp.
References __init(), constructed, id, and settings.
pd::Debug::~Debug | ( | ) |
Call the pd::Debug::close() function to free all allocated memory.
Definition at line 51 of file Debug.cpp.
References close().
|
private |
Initialize the Debug object that is going (or was) to be constructed.
Definition at line 17 of file Debug.cpp.
References constructError, file, id, and settings.
Referenced by Debug().
bool pd::Debug::close | ( | ) |
Free all the allocated memory and resources, return true if it succeeded, return false if it did not.
Definition at line 123 of file Debug.cpp.
References file.
Referenced by ~Debug().
std::pair< bool, std::string > pd::Debug::constructInfo | ( | ) |
Construct debug information You can use it if it failed to construct properly to get the error message.
Definition at line 137 of file Debug.cpp.
References constructed, and constructError.
std::fstream * pd::Debug::getFile | ( | ) | const |
std::string pd::Debug::getID | ( | ) | const |
DebugSettings pd::Debug::getSettings | ( | ) | const |
std::string pd::Debug::log | ( | const std::string & | _type, |
const std::string & | _msg, | ||
unsigned int | _level = 0 ) |
Log the message with specific custom type, message and log level.
_type | Set the type of the debug message (Ex: Information, Success, Warning, Error, ...) |
_msg | Set the message for debugging |
_level | Set the debug level level of the log (default as 0, non-debug-level specific) |
Definition at line 56 of file Debug.cpp.
|
private |
Definition at line 54 of file Debug.hpp.
Referenced by Debug(), and constructInfo().
|
private |
Definition at line 55 of file Debug.hpp.
Referenced by __init(), and constructInfo().
|
private |
|
private |
|
private |