aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Log.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-02 14:28:29 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-02 14:28:29 +0200
commit3e5b7d0544e0a595a375644ae8eaef1b3ffb4b75 (patch)
treed018f6df28e53646e36ff1b4f3f1b628dfa50909 /lib/Log.h
parent3af9de93da4344089783142503d9f6e9c308c6b6 (diff)
downloaddabmux-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.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Log.h b/lib/Log.h
index d5c39e0..f20e698 100644
--- a/lib/Log.h
+++ b/lib/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