From fa319eea94e72e14685d1a9ba9704d55b0d027fb Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 11 Jul 2016 14:53:14 +0200 Subject: Dynamically grow the area width Instead of blindly shortening the area. --- common/log.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common/log.cpp') diff --git a/common/log.cpp b/common/log.cpp index 099c043..61ba46a 100644 --- a/common/log.cpp +++ b/common/log.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include using namespace Sink::Log; @@ -360,7 +361,9 @@ QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char *file, if (useColor) { output += colorCommand(QList() << ANSI_Colors::Bold << prefixColorCode); } - output += QString(" %1 ").arg(fullDebugArea.leftJustified(25, ' ', true)); + static std::atomic maxDebugAreaSize{25}; + maxDebugAreaSize = qMax(fullDebugArea.size(), maxDebugAreaSize.load()); + output += QString(" %1 ").arg(fullDebugArea.leftJustified(maxDebugAreaSize, ' ', false)); if (useColor) { output += resetColor; } -- cgit v1.2.3