From 561aae3b03cec35e14e529f0006155ee3db07df5 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 24 Jan 2017 18:27:05 +0100 Subject: Initialise syslog earlier, don't leak the syslog backend --- src/Log.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/Log.h') diff --git a/src/Log.h b/src/Log.h index e14ca37..91c9dc3 100644 --- a/src/Log.h +++ b/src/Log.h @@ -3,7 +3,10 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C), 2014, Matthias P. Braendli, matthias.braendli@mpb.li + Copyright (C) 2017 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://www.opendigitalradio.org */ /* This file is part of ODR-DabMux. @@ -22,8 +25,7 @@ along with ODR-DabMux. If not, see . */ -#ifndef _LOG_H -#define _LOG_H +#pragma once #ifdef HAVE_CONFIG_H # include "config.h" @@ -40,6 +42,7 @@ #include #include #include +#include #define SYSLOG_IDENT "ODR-DabMux" #define SYSLOG_FACILITY LOG_LOCAL0 @@ -131,9 +134,7 @@ class LogLine; class Logger { public: - Logger() {} - - void register_backend(LogBackend* backend); + void register_backend(std::shared_ptr backend); /* Log the message to all backends */ void log(log_level_t level, const char* fmt, ...); @@ -145,7 +146,7 @@ class Logger { LogLine level(log_level_t level); private: - std::list backends; + std::list > backends; std::mutex m_cerr_mutex; }; @@ -186,5 +187,3 @@ class LogLine { }; -#endif - -- cgit v1.2.3