mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Fix(Log): Don't Put Timestamps Mid-Message
This commit is contained in:
parent
5a1a54b959
commit
5cc1b117ea
@ -129,6 +129,7 @@ namespace MWGui
|
||||
static std::mutex sBufferMutex;
|
||||
static int64_t sLogStartIndex;
|
||||
static int64_t sLogEndIndex;
|
||||
static bool hasPrefix = false;
|
||||
|
||||
void DebugWindow::startLogRecording()
|
||||
{
|
||||
@ -170,11 +171,17 @@ namespace MWGui
|
||||
addChar(c);
|
||||
if (c == '#')
|
||||
addChar(c);
|
||||
if (c == '\n')
|
||||
hasPrefix = false;
|
||||
}
|
||||
};
|
||||
for (char c : color)
|
||||
addChar(c);
|
||||
addShieldedStr(prefix);
|
||||
if (!hasPrefix)
|
||||
{
|
||||
addShieldedStr(prefix);
|
||||
hasPrefix = true;
|
||||
}
|
||||
addShieldedStr(msg);
|
||||
if (bufferOverflow)
|
||||
sLogStartIndex = (sLogEndIndex + 1) % bufSize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user