From 6b5c8df03a37278c6914855468a27cce1f432994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Tue, 14 Jun 2016 19:14:26 +0200 Subject: [PATCH] Fixed issues with color output. --- apps/plasp-app/main.cpp | 6 ++---- include/plasp/utils/LogStream.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/plasp-app/main.cpp b/apps/plasp-app/main.cpp index dc9c2c5..33deb1f 100644 --- a/apps/plasp-app/main.cpp +++ b/apps/plasp-app/main.cpp @@ -144,7 +144,8 @@ int main(int argc, char **argv) if (language == plasp::Language::Type::PDDL) { - auto context = plasp::pddl::Context(std::move(parser), std::move(logger)); + auto pddlLogger = logger; + auto context = plasp::pddl::Context(std::move(parser), std::move(pddlLogger)); auto description = plasp::pddl::Description::fromContext(std::move(context)); const auto translator = plasp::pddl::TranslatorASP(description, description.context().logger.outputStream()); translator.translate(); @@ -158,19 +159,16 @@ int main(int argc, char **argv) } catch (const plasp::utils::ParserException &e) { - plasp::utils::Logger logger; logger.logError(e.coordinate(), e.message()); return EXIT_FAILURE; } catch (const plasp::utils::TranslatorException &e) { - plasp::utils::Logger logger; logger.logError(e.what()); return EXIT_FAILURE; } catch (const std::exception &e) { - plasp::utils::Logger logger; logger.logError(e.what()); return EXIT_FAILURE; } diff --git a/include/plasp/utils/LogStream.h b/include/plasp/utils/LogStream.h index 87760f3..e44ceab 100644 --- a/include/plasp/utils/LogStream.h +++ b/include/plasp/utils/LogStream.h @@ -46,7 +46,7 @@ class LogStream LogStream(const LogStream &other) : m_standardStream{other.m_standardStream}, - m_colorPolicy{ColorPolicy::Auto} + m_colorPolicy{other.m_colorPolicy} { }