mirror of https://github.com/Icinga/icinga2.git
parent
07d9a59fe0
commit
622e4d7f25
|
@ -39,11 +39,6 @@ void StreamLogger::Start(void)
|
||||||
m_Stream = NULL;
|
m_Stream = NULL;
|
||||||
m_OwnsStream = false;
|
m_OwnsStream = false;
|
||||||
m_Tty = false;
|
m_Tty = false;
|
||||||
|
|
||||||
m_FlushLogTimer = boost::make_shared<Timer>();
|
|
||||||
m_FlushLogTimer->SetInterval(1);
|
|
||||||
m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this));
|
|
||||||
m_FlushLogTimer->Start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,8 +52,7 @@ StreamLogger::~StreamLogger(void)
|
||||||
|
|
||||||
void StreamLogger::FlushLogTimerHandler(void)
|
void StreamLogger::FlushLogTimerHandler(void)
|
||||||
{
|
{
|
||||||
if (m_OwnsStream && m_Stream)
|
m_Stream->flush();
|
||||||
m_Stream->flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
|
void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
|
||||||
|
@ -68,6 +62,11 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
|
||||||
m_Stream = stream;
|
m_Stream = stream;
|
||||||
m_OwnsStream = ownsStream;
|
m_OwnsStream = ownsStream;
|
||||||
m_Tty = IsTty(*stream);
|
m_Tty = IsTty(*stream);
|
||||||
|
|
||||||
|
m_FlushLogTimer = boost::make_shared<Timer>();
|
||||||
|
m_FlushLogTimer->SetInterval(1);
|
||||||
|
m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this));
|
||||||
|
m_FlushLogTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue