From 777c9839a17f8e13c23225114d86eb07a7df67f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Tue, 14 Jun 2016 15:06:43 +0200 Subject: [PATCH] Removed error message prefixes. --- apps/plasp-app/main.cpp | 10 +++++----- include/plasp/utils/Logger.h | 4 ++-- src/plasp/utils/Logger.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/plasp-app/main.cpp b/apps/plasp-app/main.cpp index 51149e8..4ae6205 100644 --- a/apps/plasp-app/main.cpp +++ b/apps/plasp-app/main.cpp @@ -101,7 +101,7 @@ int main(int argc, char **argv) if (language == plasp::Language::Type::Unknown) { plasp::utils::Logger logger; - logger.exception("error", "unknown input language"); + logger.logError("unknown input language"); std::cout << std::endl; printHelp(); return EXIT_FAILURE; @@ -132,25 +132,25 @@ int main(int argc, char **argv) catch (const plasp::utils::ParserException &e) { plasp::utils::Logger logger; - logger.parserException(e.coordinate(), e.message()); + logger.logError(e.coordinate(), e.message()); return EXIT_FAILURE; } catch (const plasp::utils::ParserWarning &e) { plasp::utils::Logger logger; - logger.parserException(e.coordinate(), e.message()); + logger.logError(e.coordinate(), e.message()); return EXIT_FAILURE; } catch (const plasp::utils::TranslatorException &e) { plasp::utils::Logger logger; - logger.exception("translation error", e.what()); + logger.logError(e.what()); return EXIT_FAILURE; } catch (const std::exception &e) { plasp::utils::Logger logger; - logger.exception("unexpected error", e.what()); + logger.logError(e.what()); return EXIT_FAILURE; } diff --git a/include/plasp/utils/Logger.h b/include/plasp/utils/Logger.h index cb51177..a91f3dd 100644 --- a/include/plasp/utils/Logger.h +++ b/include/plasp/utils/Logger.h @@ -38,8 +38,8 @@ class Logger void setWarningLevel(WarningLevel warningLevel); - void exception(const std::string &errorType, const std::string &message); - void parserException(const Parser::Coordinate &coordinate, const std::string &message); + void logError(const std::string &message); + void logError(const Parser::Coordinate &coordinate, const std::string &message); void parserWarning(const Parser &parser, const std::string &message); private: diff --git a/src/plasp/utils/Logger.cpp b/src/plasp/utils/Logger.cpp index e39574b..a0ded10 100644 --- a/src/plasp/utils/Logger.cpp +++ b/src/plasp/utils/Logger.cpp @@ -62,12 +62,12 @@ void Logger::setWarningLevel(WarningLevel warningLevel) //////////////////////////////////////////////////////////////////////////////////////////////////// -void Logger::exception(const std::string &errorType, const std::string &message) +void Logger::logError(const std::string &message) { if (isatty(STDERR_FILENO)) { std::cerr - << Format(Color::Red, FontWeight::Bold) << errorType << ":" + << Format(Color::Red, FontWeight::Bold) << "error:" << ResetFormat() << " " << Format(Color::White, FontWeight::Bold) << message << ResetFormat() << std::endl; @@ -84,7 +84,7 @@ void Logger::exception(const std::string &errorType, const std::string &message) //////////////////////////////////////////////////////////////////////////////////////////////////// -void Logger::parserException(const Parser::Coordinate &coordinate, const std::string &message) +void Logger::logError(const Parser::Coordinate &coordinate, const std::string &message) { if (isatty(STDERR_FILENO)) {