mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 15:14:07 +02:00
StreamLogger#BindStream(): set #m_FlushLogTimer only if needed
refs #6737
This commit is contained in:
parent
ccbe9f7fbe
commit
622f684124
@ -55,11 +55,13 @@ 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();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes a log entry and outputs it to a stream.
|
* Processes a log entry and outputs it to a stream.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user