/** * Low-level log-printing function: prefix message by timestamp if given. */ void LogPrintf_va (LogLevel_t level, const char* format, va_list va ) { if ( LogLevel < level ) return; if (LogOutput == NULL) LogOutput = LogOutputDefault; fprintf(LogOutput, "%s (%d) [%s]: ", LogGetTimestamp(), getpid(), LogFormatLevel(level) ); vfprintf(LogOutput, format, va); fflush(LogOutput); return; } /* LogPrintf_va() */
/** * Output the given log-message, prefixed by a timestamp and level, if LogLevel() >= level */ void LogPrintf (LogLevel_t level, const char* format, ...) { if ( LogLevel() < level ) return; va_list va; va_start(va, format); fprintf(LogFile(), "%s (%d) [%s]: ", LogGetTimestamp(), getpid(), LogFormatLevel(level) ); vfprintf(LogFile(), format, va); fflush(LogFile()); va_end(va); } /* LogPrintf() */