aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r--src/ConfigParser.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 350c278..c90b150 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -123,8 +123,7 @@ static void parse_configfile(
// log parameters:
if (pt.GetInteger("log.syslog", 0) == 1) {
- LogToSyslog* log_syslog = new LogToSyslog();
- etiLog.register_backend(log_syslog);
+ etiLog.register_backend(make_shared<LogToSyslog>());
}
if (pt.GetInteger("log.filelog", 0) == 1) {
@@ -138,14 +137,12 @@ static void parse_configfile(
throw std::runtime_error("Configuration error");
}
- LogToFile* log_file = new LogToFile(logfilename);
- etiLog.register_backend(log_file);
+ etiLog.register_backend(make_shared<LogToFile>(logfilename));
}
std::string trace_filename = pt.Get("log.trace", "");
if (not trace_filename.empty()) {
- LogTracer* tracer = new LogTracer(trace_filename);
- etiLog.register_backend(tracer);
+ etiLog.register_backend(make_shared<LogTracer>(trace_filename));
}