void FileLogHandler::writeFooter() { static int callCount = 0; m_pLogFile->writeChar(getDefaultFooter()); /** * The reason I also check the number of log entries instead of * only the log size, is that I do not want to check the file size * after each log entry which requires system calls and is quite slow. * TODO: Any better way? */ if (callCount % m_maxLogEntries != 0) // Check every m_maxLogEntries { if (isTimeForNewFile()) { if (!createNewFile()) { // Baby one more time... createNewFile(); } } callCount = 0; } callCount++; m_pLogFile->flush(); }
void ConsoleLogHandler::writeFooter() { ndbout << getDefaultFooter() << flush; }