From 30d84ef9ad4a0010288db18294766fd4d5ed6f4a Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 21 Oct 2024 11:30:51 +0200 Subject: incorporate feedback --- src/crepe/util/log.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crepe/util/log.cpp b/src/crepe/util/log.cpp index f012c67..0c2ce1e 100644 --- a/src/crepe/util/log.cpp +++ b/src/crepe/util/log.cpp @@ -15,13 +15,13 @@ static const char * const LOG_PREFIX[] = { [log_level::ERROR] = "[ERR] ", }; -static void log(enum log_level level, const std::string msg) { +static void log(enum log_level level, const std::string & msg) { using namespace std; - string final = string(LOG_PREFIX[level]) + msg; - if (!final.ends_with("\n")) final += "\n"; + string out = string(LOG_PREFIX[level]) + msg; + if (!out.ends_with("\n")) out += "\n"; // TODO: also log to file or smth - printf("%s", final.c_str()); + printf("%s", out.c_str()); fflush(stdout); } -- cgit v1.2.3