1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-31 13:11:48 +02:00

Initial implementation of the internal debugging system.

This commit is contained in:
Sandu Liviu Catalin
2015-11-10 14:42:52 +02:00
parent dfc5701799
commit 3da18ee02b
6 changed files with 658 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
#include "Base/Shared.hpp"
#include "Register.hpp"
#include "Logger.hpp"
#include "Debug.hpp"
#include "Core.hpp"
// ------------------------------------------------------------------------------------------------
@@ -254,6 +255,83 @@ void LogFtl(const char * fmt, ...)
va_end(args);
}
// ------------------------------------------------------------------------------------------------
void DbgWrn(const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(NULL, NULL, fmt, args);
va_end(args);
}
void DbgErr(const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(NULL, NULL, fmt, args);
va_end(args);
}
void DbgFtl(const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(NULL, NULL, fmt, args);
va_end(args);
}
// ------------------------------------------------------------------------------------------------
void DbgWrn(const char * func, const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(NULL, func, fmt, args);
va_end(args);
}
void DbgErr(const char * func, const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(NULL, func, fmt, args);
va_end(args);
}
void DbgFtl(const char * func, const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(NULL, func, fmt, args);
va_end(args);
}
// ------------------------------------------------------------------------------------------------
void DbgWrn(const char * type, const char * func, const char * fmt, ...)
{
va_list args;
va_start(args, fmt);
_Dbg->Wrn(type, func, fmt, args);
va_end(args);
}
void DbgErr(const char * type, const char * func, const char * fmt, ...)
{
_Dbg->SetInf(type, func);
va_list args;
va_start(args, fmt);
_Dbg->Wrn(type, func, fmt, args);
va_end(args);
}
void DbgFtl(const char * type, const char * func, const char * fmt, ...)
{
_Dbg->SetInf(type, func);
va_list args;
va_start(args, fmt);
_Dbg->Wrn(type, func, fmt, args);
va_end(args);
}
// ------------------------------------------------------------------------------------------------
const SQChar * ToStringF(const char * fmt, ...)
{

View File

@@ -84,7 +84,7 @@ template<> inline Float64 Clamp(const Float64 val, const Float64 min, const Floa
}
/* ------------------------------------------------------------------------------------------------
* Simple functions to quickly forward logging messages without including the logging system
* Simple functions to quickly forward logging messages without including the logging system.
*/
void LogDbg(const char * fmt, ...);
void LogMsg(const char * fmt, ...);
@@ -94,6 +94,21 @@ void LogWrn(const char * fmt, ...);
void LogErr(const char * fmt, ...);
void LogFtl(const char * fmt, ...);
/* ------------------------------------------------------------------------------------------------
* Simple functions to quickly forward debugging messages without including the debugging system.
*/
void DbgWrn(const char * fmt, ...);
void DbgErr(const char * fmt, ...);
void DbgFtl(const char * fmt, ...);
void DbgWrn(const char * func, const char * fmt, ...);
void DbgErr(const char * func, const char * fmt, ...);
void DbgFtl(const char * func, const char * fmt, ...);
void DbgWrn(const char * type, const char * func, const char * fmt, ...);
void DbgErr(const char * type, const char * func, const char * fmt, ...);
void DbgFtl(const char * type, const char * func, const char * fmt, ...);
/* ------------------------------------------------------------------------------------------------
* ...
*/