Hello!
I have a logging class to log all errors/warnings and other messages in my project. The log function goes like so :
[source lang=cpp]
//------------------------------------------------------
// AddLogEntry
//
// Adds a log entry into the html file
//------------------------------------------------------
bool BGL::CBGLLogger::AddLogEntry(LOGTYPE logtype,
char * const codelocation, char * const entry, bool logged, bool messageboxed, bool printfed, ...)
{
if((int)logtype < m_bFileLoggingMinLevel) return true;
va_list args;
va_start(args, printfed);
char * message = new char[_vscprintf(entry,args)];
vsprintf(message,entry,args);
... and then "message" is outputted into a file.
a sample call:
BGL::Logger.AddLogEntry(BGL::CBGLLogger::LOGTYPE_USELESSINFO,
"BGL::CBGL3dsLoader::Load()","My text hey, look it's myvariable : %i", true, false, true, myvariable);
However my code uses ellipses and old output functions, I which to correct that.
How can I arrange my code so it doesn't use ellipses but still can output different types of variables along with the text (float, int, double) ?
Anyone has a proposition? Or another way to handle the problem?