PND missing output


Pickle

Mega GP Mania
Joined
May 30, 2006
Messages
5,518
Location
Detroit, Michigan
Website
Visit site
Ive noticed this for a while and no idea why it is this way. Maybe its a bug in the system.

When i use my launcher and I open the pnd log of the output in /tmp Im always missing the output from the launcher. I do get the output from the target app, but nothing from the launcher, except when i close the launcher.

Any ideas?
 
Wild guess from someone who doesn't know how this log file gets generated... but presumably you have a pipe to the logfile. Are you flushing that pipe at any point?
 
This is all im doing:

Code:
void CBase::Log( const char* output, ... )
{
    va_list fmtargs;
    char buffer[1024];

    va_start( fmtargs, output );
    vsnprintf( buffer, sizeof(buffer)-1, output, fmtargs );
    va_end( fmtargs );

    fprintf( stdout, "%s", buffer );
 
 
Yeah, that looks to me like a buffering problem to me. Stdout is a buffered file pipe, though it should get flushed if it contains an endl at the end of it, according to this query. Still, usually safer to flush explicitly rather than rely on messages being correctly formatted.
 
Back
Top