Dragonfly Q&A

Problem with LogManager

0 like 0 dislike
For some reason, the code line

df::LogManager::getInstance( ).writeLog( "Hello World! Here is an integer: %d! Here is a string: %s!", 7, "7" );

Is printing to the logfile the following

Hello World! Here is an integer: 3602796! Here is a string: 0รป6!

These appear to be pointers, but I don't know why they would be.
asked Sep 12, 2015 by Andrew

1 Answer

0 like 0 dislike

Hmm.  Your use of the writeLog() method is formatted correctly, to the problem is likely in your writeLog() implementation.

Try getting the code in Listing 4.4 working.  In other words, see if the call to:

writeMessage( "Hello World! Here is an integer: %d! Here is a string: %s!", 7, "7" );

works.  If so, the see if your implementation of writeLog() does something different.

If both of those fail, you can send your writeLog() implementation to the imgd3000-staff@cs list and we can take a look.

answered Sep 12, 2015 by claypool
Thank you! As it turns out, I was using <code>fprintf</code> instead of <code>vfprintf</code>
More information about Dragonfly can be found on the Dragonfly Home Page.
...