mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 16:14:09 +02:00
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_Stream = stream;
|
||||||
m_OwnsStream = ownsStream;
|
m_OwnsStream = ownsStream;
|
||||||
|
|
||||||
|
if (!m_FlushLogTimer) {
|
||||||
m_FlushLogTimer = new Timer();
|
m_FlushLogTimer = new Timer();
|
||||||
m_FlushLogTimer->SetInterval(1);
|
m_FlushLogTimer->SetInterval(1);
|
||||||
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
|
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
|
||||||
m_FlushLogTimer->Start();
|
m_FlushLogTimer->Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user