From 2046edbee3a5b6134c16044d56306f6f00774c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 24 Nov 2016 02:57:33 +0100 Subject: [PATCH] Enabled new output in app. --- app/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 5895926..ea2e3d6 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -7,6 +7,8 @@ int main(int argc, char **argv) { + anthem::Context context; + namespace po = boost::program_options; po::options_description description("Allowed options"); @@ -23,14 +25,12 @@ int main(int argc, char **argv) const auto printHelp = [&]() { - std::cout << "Usage: anthem [files] [options]" << std::endl; - std::cout << "Translate ASP programs to the language of first-order theorem provers." << std::endl << std::endl; - - std::cout << description; + std::cout + << "Usage: anthem [files] [options]" << std::endl + << "Translate ASP programs to the language of first-order theorem provers." << std::endl << std::endl + << description; }; - anthem::Context context; - try { po::store(po::command_line_parser(argc, argv) @@ -42,7 +42,7 @@ int main(int argc, char **argv) } catch (const po::error &e) { - std::cerr << "error: " << e.what() << std::endl; + context.logger.log(anthem::output::Priority::Error, e.what()); printHelp(); return EXIT_FAILURE; } @@ -71,7 +71,7 @@ int main(int argc, char **argv) } catch (const std::exception &e) { - std::cerr << "error: " << e.what() << std::endl; + context.logger.log(anthem::output::Priority::Error, e.what()); return EXIT_FAILURE; }