Jump to content
  • Advertisement
Sign in to follow this  
Trillian

An elternative to ellipses?

This topic is 4647 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!