aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/Log.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-02 14:26:04 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-02 14:26:04 +0200
commit29d602422cea4e9f2a59b8cefdb17b3862642e01 (patch)
treea4442774276ea4df6cd5163f8252d04a545bfff1 /contrib/Log.h
parent2475666652ca54cf3b53f5837ab5e97f69593397 (diff)
downloadODR-AudioEnc-29d602422cea4e9f2a59b8cefdb17b3862642e01.tar.gz
ODR-AudioEnc-29d602422cea4e9f2a59b8cefdb17b3862642e01.tar.bz2
ODR-AudioEnc-29d602422cea4e9f2a59b8cefdb17b3862642e01.zip
Apply b1fc144 from common
Diffstat (limited to 'contrib/Log.h')
-rw-r--r--contrib/Log.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/contrib/Log.h b/contrib/Log.h
index d5c39e0..f20e698 100644
--- a/contrib/Log.h
+++ b/contrib/Log.h
@@ -133,16 +133,10 @@ struct log_message_t {
class Logger {
public:
- Logger() {
- m_io_thread = std::thread(&Logger::io_process, this);
- }
-
+ Logger();
Logger(const Logger& other) = delete;
const Logger& operator=(const Logger& other) = delete;
- ~Logger() {
- m_message_queue.trigger_wakeup();
- m_io_thread.join();
- }
+ ~Logger();
void register_backend(std::shared_ptr<LogBackend> backend);
@@ -163,9 +157,11 @@ class Logger {
ThreadsafeQueue<log_message_t> m_message_queue;
std::thread m_io_thread;
- std::mutex m_cerr_mutex;
+ std::mutex m_backend_mutex;
};
+/* etiLog is a singleton used in all parts of the program to output log messages.
+ * It is constructed in Globals.cpp */
extern Logger etiLog;
// Accumulate a line of logs, using same syntax as stringstream