Documentation for Logger

Former-commit-id: b09dda8a542782667070ea8bf912b552dd6b478a
This commit is contained in:
Gawaboumga
2016-02-21 14:34:59 +01:00
parent d340553023
commit 07547bdd9f
4 changed files with 152 additions and 17 deletions

View File

@@ -11,17 +11,34 @@ namespace Nz
namespace
{
const char* errorType[] = {
"Assert failed: ", // ErrorType_AssertFailed
"Internal error: ", // ErrorType_Internal
"Error: ", // ErrorType_Normal
"Warning: " // ErrorType_Warning
"Assert failed: ", // ErrorType_AssertFailed
"Internal error: ", // ErrorType_Internal
"Error: ", // ErrorType_Normal
"Warning: " // ErrorType_Warning
};
static_assert(sizeof(errorType) / sizeof(const char*) == ErrorType_Max + 1, "Error type array is incomplete");
}
/*!
* \class Nz::AbstractLogger<T>
* \brief Core class that represents the behaviour of the log classes
*
* \remark This class is abstract
*/
AbstractLogger::~AbstractLogger() = default;
/*!
* \brief Writes the error in StringStream
*
* \param type Enumeration of type ErrorType
* \param error String describing the error
* \param line Line number in the file
* \param file Filename
* \param function Name of the function throwing the error
*/
void AbstractLogger::WriteError(ErrorType type, const String& error, unsigned int line, const char* file, const char* function)
{
StringStream stream;