mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 05:34:48 +02:00
StreamLogger#BindStream(): set #m_FlushLogTimer only if needed
refs #6737 (cherry picked from commit 622f68412440d4fa3ac1b347a929087073bc24f9)
This commit is contained in:
parent
304ba1fd6c
commit
f551666a7d
@ -72,10 +72,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