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
This commit is contained in:
Islam AbdelRahman 2015-02-20 10:58:29 -08:00
parent 92416fa7f2
commit 06a766de56
2 changed files with 7 additions and 0 deletions

View File

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

View File

@ -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;