tm=gmtime(&now);
strftime(timebuf,100,"%Y-%m-%d %H:%M:%S",tm);
fprintf(stderr,"[%s] %s(%s): %s\n",timebuf,sevtostring(severity),source,buf);
- if (logfile)
+ fflush(stderr);
+
+ if (logfile) {
fprintf(logfile,"[%s] %s(%s): %s\n",timebuf,sevtostring(severity),source,buf);
+ fflush(logfile);
+ }
}
if (severity>=ERR_STOP) {