From de9d6ffc8514b513458b73ca25c2123f11d299a7 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Sun, 13 Oct 2024 20:42:14 +0200 Subject: [PATCH] flush all prints --- src/Logger.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Logger.cpp b/src/Logger.cpp index 860ed46..da5b5d1 100644 --- a/src/Logger.cpp +++ b/src/Logger.cpp @@ -51,35 +51,35 @@ void addToLog(const std::string& Line) { } void info(const std::string& toPrint) { std::string Print = getDate() + "[INFO] " + toPrint + "\n"; - std::cout << Print; + std::cout << Print << std::flush; addToLog(Print); } void debug(const std::string& toPrint) { std::string Print = getDate() + "[DEBUG] " + toPrint + "\n"; if (options.verbose) { - std::cout << Print; + std::cout << Print << std::flush; } addToLog(Print); } void warn(const std::string& toPrint) { std::string Print = getDate() + "[WARN] " + toPrint + "\n"; - std::cout << Print; + std::cout << Print << std::flush; addToLog(Print); } void error(const std::string& toPrint) { std::string Print = getDate() + "[ERROR] " + toPrint + "\n"; - std::cout << Print; + std::cout << Print << std::flush; addToLog(Print); } void fatal(const std::string& toPrint) { std::string Print = getDate() + "[FATAL] " + toPrint + "\n"; - std::cout << Print; + std::cout << Print << std::flush; addToLog(Print); std::this_thread::sleep_for(std::chrono::seconds(5)); std::exit(1); } void except(const std::string& toPrint) { std::string Print = getDate() + "[EXCEP] " + toPrint + "\n"; - std::cout << Print; + std::cout << Print << std::flush; addToLog(Print); }