diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-22 21:54:56 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-22 21:54:56 +0200 |
commit | c8a331c8000004ff68422e034332890c002b04c3 (patch) | |
tree | a4d83a932753d8134cb36d3f7e486a36f89ee9e4 /src/Log.cpp | |
parent | 96635c032658cc3d45007c02a0701a5961a40c39 (diff) | |
download | dabmod-c8a331c8000004ff68422e034332890c002b04c3.tar.gz dabmod-c8a331c8000004ff68422e034332890c002b04c3.tar.bz2 dabmod-c8a331c8000004ff68422e034332890c002b04c3.zip |
Take some Log improvements from ODR-DabMux
Diffstat (limited to 'src/Log.cpp')
-rw-r--r-- | src/Log.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Log.cpp b/src/Log.cpp index 81f7955..15c02d0 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -3,10 +3,10 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2016 + Copyright (C) 2018 Matthias P. Braendli, matthias.braendli@mpb.li - http://opendigitalradio.org + http://www.opendigitalradio.org */ /* This file is part of ODR-DabMod. @@ -26,7 +26,7 @@ */ #include <list> -#include <stdarg.h> +#include <cstdarg> #include <chrono> #include "Log.h" @@ -41,10 +41,9 @@ using namespace std; */ Logger etiLog; - -void Logger::register_backend(LogBackend* backend) { +void Logger::register_backend(std::shared_ptr<LogBackend> backend) +{ backends.push_back(backend); - //log(info, "Registered new logger " + backend->get_name()); } @@ -68,13 +67,13 @@ void Logger::log(log_level_t level, const char* fmt, ...) size *= 2; } - logstr(level, str); + logstr(level, move(str)); } -void Logger::logstr(log_level_t level, std::string message) +void Logger::logstr(log_level_t level, std::string&& message) { - log_message_t m(level, message); - m_message_queue.push(std::move(m)); + log_message_t m(level, move(message)); + m_message_queue.push(move(m)); } void Logger::io_process() |