From 9d06c2ebc1ab5376eced52a6437d64c576915543 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 20 Jun 2015 16:27:36 +0200 Subject: o Configuring better logging output. --- apps/apps.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/apps.cpp b/apps/apps.cpp index 80fae13..b9ee81c 100644 --- a/apps/apps.cpp +++ b/apps/apps.cpp @@ -1,5 +1,7 @@ #include "apps.h" #include +#include +#include #include #include @@ -17,8 +19,12 @@ const po::options_description logging_options() { } void setup_logging(po::variables_map vm) { - BasicConfigurator config; - config.configure(); + Appender *console = new ConsoleAppender(true, true); + PatternLayout* layout = new PatternLayout(LOG4CPLUS_TEXT("%-5p %r %-20c %m%n")); + console->setLayout(auto_ptr(layout)); + + Hierarchy &h = Logger::getDefaultHierarchy(); + h.getRoot().addAppender(SharedAppenderPtr(console)); } int launch_app(int argc, char *argv[], app &app) { -- cgit v1.2.3