mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7130 from Icinga/bugfix/logrotate-issues-6737
StreamLogger#BindStream(): set #m_FlushLogTimer only if needed
This commit is contained in:
commit
f747e6b405
|
@ -55,10 +55,12 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
|
|||
m_Stream = stream;
|
||||
m_OwnsStream = ownsStream;
|
||||
|
||||
m_FlushLogTimer = new Timer();
|
||||
m_FlushLogTimer->SetInterval(1);
|
||||
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
|
||||
m_FlushLogTimer->Start();
|
||||
if (!m_FlushLogTimer) {
|
||||
m_FlushLogTimer = new Timer();
|
||||
m_FlushLogTimer->SetInterval(1);
|
||||
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
|
||||
m_FlushLogTimer->Start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue