MCPcopy Create free account
hub / github.com/Icinga/icinga2 / BindStream

Method BindStream

lib/base/streamlogger.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
52{
53 ObjectLock olock(this);
54
55 if (m_Stream && m_OwnsStream)
56 delete m_Stream;
57
58 m_Stream = stream;
59 m_OwnsStream = ownsStream;
60
61 if (!m_FlushLogTimer) {
62 m_FlushLogTimer = Timer::Create();
63 m_FlushLogTimer->SetInterval(1);
64 m_FlushLogTimer->OnTimerExpired.connect([this](const Timer * const&) { FlushLogTimerHandler(); });
65 m_FlushLogTimer->Start();
66 }
67}
68
69/**
70 * Processes a log entry and outputs it to a stream.

Callers

nothing calls this directly

Calls 2

SetIntervalMethod · 0.80
StartMethod · 0.45

Tested by

no test coverage detected