Sign in to follow this  

An elternative to ellipses?

This topic is 4344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites

This topic is 4344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this