mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-28 20:06:40 +00:00
Fix(Log): Don't Put Timestamps Mid-Message
This commit is contained in:
parent
5a1a54b959
commit
5cc1b117ea
1 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||
if (!hasPrefix)
|
||||
{
|
||||
addShieldedStr(prefix);
|
||||
hasPrefix = true;
|
||||
}
|
||||
addShieldedStr(msg);
|
||||
if (bufferOverflow)
|
||||
sLogStartIndex = (sLogEndIndex + 1) % bufSize;
|
||||
|
|
Loading…
Reference in a new issue