X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=bab74583c52248d9cdd6fe569c3fba12468ba864;hp=20d85cff49417ac8ae6206f377b85198483b49ef;hb=e571e2c52e93e0dc794a620a7bb6a67f4cf0adb2;hpb=45bc91b9a909035252ee10afe4fed2eef996e4ed diff --git a/src/lib/util.cc b/src/lib/util.cc index 20d85cff4..bab74583c 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -360,6 +360,34 @@ dcpomatic_setup_path_encoding () #endif } + +class LogSink : public Kumu::ILogSink +{ +public: + LogSink () {} + LogSink (LogSink const&) = delete; + LogSink& operator= (LogSink const&) = delete; + + void WriteEntry(const Kumu::LogEntry& entry) override { + Kumu::AutoMutex L(m_lock); + WriteEntryToListeners(entry); + if (entry.TestFilter(m_filter)) { + string buffer; + entry.CreateStringWithOptions(buffer, m_options); + LOG_GENERAL("asdcplib: %1", buffer); + } + } +}; + + +void +capture_asdcp_logs () +{ + static LogSink log_sink; + Kumu::SetDefaultLogSink(&log_sink); +} + + /** Call the required functions to set up DCP-o-matic's static arrays, etc. * Must be called from the UI thread, if there is one. */ @@ -1012,33 +1040,6 @@ start_of_thread (string) #endif -class LogSink : public Kumu::ILogSink -{ -public: - LogSink () {} - LogSink (LogSink const&) = delete; - LogSink& operator= (LogSink const&) = delete; - - void WriteEntry(const Kumu::LogEntry& entry) override { - Kumu::AutoMutex L(m_lock); - WriteEntryToListeners(entry); - if (entry.TestFilter(m_filter)) { - string buffer; - entry.CreateStringWithOptions(buffer, m_options); - LOG_GENERAL("asdcplib: %1", buffer); - } - } -}; - - -void -capture_asdcp_logs () -{ - static LogSink log_sink; - Kumu::SetDefaultLogSink(&log_sink); -} - - string error_details(boost::system::error_code ec) {