diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-05 15:32:10 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-05 15:32:10 +0000 |
| commit | 3ec4338ce90ea0549409312f24f8b28c07a5d2da (patch) | |
| tree | 09aaaff66dd860abbeacc20793145e1a27f4defd /asdcplib/src/KM_log.cpp | |
| parent | 342aad2ddf893aaaafa9a2c9980579d2dc4ec125 (diff) | |
asdcplib 2.5.11
Diffstat (limited to 'asdcplib/src/KM_log.cpp')
| -rwxr-xr-x | asdcplib/src/KM_log.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/asdcplib/src/KM_log.cpp b/asdcplib/src/KM_log.cpp index 7bd59264..dc7bf3f2 100755 --- a/asdcplib/src/KM_log.cpp +++ b/asdcplib/src/KM_log.cpp @@ -25,7 +25,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*! \file KM_log.cpp - \version $Id: KM_log.cpp,v 1.15 2011/03/08 19:03:47 jhurst Exp $ + \version $Id: KM_log.cpp,v 1.17 2012/09/20 21:19:23 jhurst Exp $ \brief message logging API */ @@ -90,7 +90,8 @@ Kumu::DefaultLogSink() void Kumu::EntryListLogSink::WriteEntry(const LogEntry& Entry) { - AutoMutex L(m_Lock); + AutoMutex L(m_lock); + WriteEntryToListeners(Entry); if ( Entry.TestFilter(m_filter) ) m_Target.push_back(Entry); @@ -102,13 +103,15 @@ Kumu::EntryListLogSink::WriteEntry(const LogEntry& Entry) void Kumu::StdioLogSink::WriteEntry(const LogEntry& Entry) { - AutoMutex L(m_Lock); std::string buf; + AutoMutex L(m_lock); + WriteEntryToListeners(Entry); if ( Entry.TestFilter(m_filter) ) { Entry.CreateStringWithOptions(buf, m_options); fputs(buf.c_str(), m_stream); + fflush(m_stream); } } @@ -121,8 +124,9 @@ Kumu::StdioLogSink::WriteEntry(const LogEntry& Entry) void Kumu::WinDbgLogSink::WriteEntry(const LogEntry& Entry) { - AutoMutex L(m_Lock); std::string buf; + AutoMutex L(m_lock); + WriteEntryToListeners(Entry); if ( Entry.TestFilter(m_filter) ) { @@ -140,8 +144,9 @@ Kumu::WinDbgLogSink::WriteEntry(const LogEntry& Entry) void Kumu::StreamLogSink::WriteEntry(const LogEntry& Entry) { - AutoMutex L(m_Lock); std::string buf; + AutoMutex L(m_lock); + WriteEntryToListeners(Entry); if ( Entry.TestFilter(m_filter) ) { @@ -186,7 +191,7 @@ Kumu::SyslogLogSink::~SyslogLogSink() void Kumu::SyslogLogSink::WriteEntry(const LogEntry& Entry) { - int priority = 0; + int priority; switch ( Entry.Type ) { @@ -199,7 +204,8 @@ Kumu::SyslogLogSink::WriteEntry(const LogEntry& Entry) case Kumu::LOG_DEBUG: priority = SYSLOG_DEBUG; break; } - AutoMutex L(m_Lock); + AutoMutex L(m_lock); + WriteEntryToListeners(Entry); if ( Entry.TestFilter(m_filter) ) { |
