diff options
Diffstat (limited to 'common/log.cpp')
-rw-r--r-- | common/log.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ | |||
10 | #include <iostream> | 10 | #include <iostream> |
11 | #include <unistd.h> | 11 | #include <unistd.h> |
12 | #include <memory> | 12 | #include <memory> |
13 | #include <atomic> | ||
13 | #include <definitions.h> | 14 | #include <definitions.h> |
14 | 15 | ||
15 | using namespace Sink::Log; | 16 | using namespace Sink::Log; |
@@ -360,7 +361,9 @@ QDebug Sink::Log::debugStream(DebugLevel debugLevel, int line, const char *file, | |||
360 | if (useColor) { | 361 | if (useColor) { |
361 | output += colorCommand(QList<int>() << ANSI_Colors::Bold << prefixColorCode); | 362 | output += colorCommand(QList<int>() << ANSI_Colors::Bold << prefixColorCode); |
362 | } | 363 | } |
363 | output += QString(" %1 ").arg(fullDebugArea.leftJustified(25, ' ', true)); | 364 | static std::atomic<int> maxDebugAreaSize{25}; |
365 | maxDebugAreaSize = qMax(fullDebugArea.size(), maxDebugAreaSize.load()); | ||
366 | output += QString(" %1 ").arg(fullDebugArea.leftJustified(maxDebugAreaSize, ' ', false)); | ||
364 | if (useColor) { | 367 | if (useColor) { |
365 | output += resetColor; | 368 | output += resetColor; |
366 | } | 369 | } |