From f887893ae3e46dea6c2bbefa42f9e227f9afb08c Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Wed, 12 Feb 2025 07:46:57 +0000 Subject: [PATCH] Fix https://gitlab.eclipse.org/eclipse/aidge/aidge_core/-/issues/232 --- src/utils/Log.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/utils/Log.cpp b/src/utils/Log.cpp index 9755aa61d..f4bc32e8b 100644 --- a/src/utils/Log.cpp +++ b/src/utils/Log.cpp @@ -104,8 +104,13 @@ void Log::log(Level level, const std::string& msg) { while (start < text.size()) { std::size_t lineWidth = 0; std::size_t current = start; - - while (current < text.size() && lineWidth < width) { + bool inPath = false; + while (current < text.size() && (lineWidth < width || inPath)) { + if (inPath){ + if (text[current] == ' ' || text[current] == '\n'){ + inPath = false; + } + } if (text[current] == '\033') { // Found ANSI escape sequence, skip until 'm' std::size_t ansiEnd = text.find('m', current); @@ -121,6 +126,9 @@ void Log::log(Level level, const std::string& msg) { // Handle explicit line break break; } else { + if(!inPath && (text[current] == '/' || text[current] == '\\')) { + inPath = true; + } // Normal character, increase line width ++lineWidth; ++current; @@ -164,7 +172,7 @@ void Log::log(Level level, const std::string& msg) { // Get the string representation of the log level const auto levelStr = EnumStrings<Level>::data[static_cast<std::size_t>(level)]; const std::size_t levelIndentSizes[6] = {10, 9, 11, 12, 10, 10}; - const std::size_t width = 80 - levelIndentSizes[static_cast<std::size_t>(level)]; + const std::size_t width = 100 - levelIndentSizes[static_cast<std::size_t>(level)]; if (level >= getConsoleLevel()) { for (const auto& context : mContext) { -- GitLab