From c760edb1412685b1fd40cb7fe36422bb6fb5a36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 24 Nov 2016 03:36:14 +0100 Subject: [PATCH] Fixed missing usages of new output format. --- include/anthem/Body.h | 2 +- include/anthem/StatementVisitor.h | 3 ++- src/anthem/Translation.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/anthem/Body.h b/include/anthem/Body.h index 367005c..169b2b3 100644 --- a/include/anthem/Body.h +++ b/include/anthem/Body.h @@ -90,7 +90,7 @@ struct TermPrintVisitor outputStream << " " << Clingo::AST::BinaryOperator::And << " "; if (literal.sign == Clingo::AST::Sign::Negation) - std::cout << Clingo::AST::Sign::Negation << " "; + outputStream << Clingo::AST::Sign::Negation << " "; outputStream << output::Function(function.name) << "("; diff --git a/include/anthem/StatementVisitor.h b/include/anthem/StatementVisitor.h index f198cc4..0516769 100644 --- a/include/anthem/StatementVisitor.h +++ b/include/anthem/StatementVisitor.h @@ -19,7 +19,8 @@ struct StatementVisitor { void visit(const Clingo::AST::Program &program, const Clingo::AST::Statement &statement, Context &context) { - context.logger.log(output::Priority::Debug, program.name); + // TODO: refactor + context.logger.log(output::Priority::Debug, (std::string("[program] ") + program.name).c_str()); if (!program.parameters.empty()) throwErrorAtLocation(statement.location, "program parameters currently unsupported", context); diff --git a/src/anthem/Translation.cpp b/src/anthem/Translation.cpp index 87b8cb6..5723768 100644 --- a/src/anthem/Translation.cpp +++ b/src/anthem/Translation.cpp @@ -32,7 +32,8 @@ void translate(const std::vector &fileNames, Context &context) void translate(const char *fileName, std::istream &stream, Context &context) { - std::cout << "info: reading " << fileName << std::endl; + // TODO: refactor + context.logger.log(output::Priority::Note, (std::string("reading ") + fileName).c_str()); auto fileContent = std::string(std::istreambuf_iterator(stream), {});