Adding Flush to AutoRollLogger

Summary:
During running AutoRollLoggerTest on FreeBSD we have found out that AutoRollLogger is not flushing correctly (test fails on FreeBSD)
This diff add Flush to AutoRollLogger to fix this problem

Test Plan:
[My machine] make all check ( all tests pass)
[FreeBSD VM] running AutoRollLoggerTest ( all tests pass )

Reviewers: sdong, igor

Reviewed By: igor

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D33633
main
Islam AbdelRahman 10 years ago
parent 92416fa7f2
commit 06a766de56
  1. 6
      util/auto_roll_logger.h
  2. 1
      util/auto_roll_logger_test.cc

@ -56,6 +56,12 @@ class AutoRollLogger : public Logger {
return logger_->GetLogFileSize();
}
void Flush() {
if (logger_) {
logger_->Flush();
}
}
virtual ~AutoRollLogger() {
}

@ -308,6 +308,7 @@ TEST(AutoRollLoggerTest, LogHeaderTest) {
Info(&logger, (kSampleMessage + ":LogHeaderTest line %d").c_str(), i);
++i;
}
LogFlush(&logger);
// verify that the new log contains all the header logs
std::stringstream ssbuf;

Loading…
Cancel
Save