diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-09-02 14:28:29 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-09-02 14:28:29 +0200 |
commit | 3e5b7d0544e0a595a375644ae8eaef1b3ffb4b75 (patch) | |
tree | d018f6df28e53646e36ff1b4f3f1b628dfa50909 /lib/Log.h | |
parent | 3af9de93da4344089783142503d9f6e9c308c6b6 (diff) | |
download | dabmux-3e5b7d0544e0a595a375644ae8eaef1b3ffb4b75.tar.gz dabmux-3e5b7d0544e0a595a375644ae8eaef1b3ffb4b75.tar.bz2 dabmux-3e5b7d0544e0a595a375644ae8eaef1b3ffb4b75.zip |
Apply b1fc144 from common
Diffstat (limited to 'lib/Log.h')
-rw-r--r-- | lib/Log.h | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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 |