From 6b245ee64a828dd86da0acf6ffb56b618b170ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 13 Dec 2016 23:37:43 +0100 Subject: Switch back to using std::cout instead of std::clog --- louloulibs/logger/logger.cpp | 2 +- tests/logger.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/louloulibs/logger/logger.cpp b/louloulibs/logger/logger.cpp index 79f9e8f..92a3d9b 100644 --- a/louloulibs/logger/logger.cpp +++ b/louloulibs/logger/logger.cpp @@ -3,7 +3,7 @@ Logger::Logger(const int log_level): log_level(log_level), - stream(std::clog.rdbuf()), + stream(std::cout.rdbuf()), null_buffer{}, null_stream{&null_buffer} { diff --git a/tests/logger.cpp b/tests/logger.cpp index bde28c9..1d59a22 100644 --- a/tests/logger.cpp +++ b/tests/logger.cpp @@ -23,14 +23,14 @@ TEST_CASE("Basic logging") Config::set("log_level", "0"); WHEN("we log some debug text") { - IoTester out(std::clog); + IoTester out(std::cout); log_debug("deb", "ug"); THEN("debug logs are written") CHECK(out.str() == debug_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\tdebug\n"); } WHEN("we log some errors") { - IoTester out(std::clog); + IoTester out(std::cout); log_error("err", 12, "or"); THEN("error logs are written") CHECK(out.str() == error_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\terr12or\n"); @@ -41,14 +41,14 @@ TEST_CASE("Basic logging") Config::set("log_level", "3"); WHEN("we log some debug text") { - IoTester out(std::clog); + IoTester out(std::cout); log_debug(123, "debug"); THEN("nothing is written") CHECK(out.str().empty()); } WHEN("we log some errors") { - IoTester out(std::clog); + IoTester out(std::cout); log_error(123, " errors"); THEN("error logs are still written") CHECK(out.str() == error_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\t123 errors\n"); -- cgit v1.2.3