mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 11:36: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 std::mutex sBufferMutex;
|
||||||
static int64_t sLogStartIndex;
|
static int64_t sLogStartIndex;
|
||||||
static int64_t sLogEndIndex;
|
static int64_t sLogEndIndex;
|
||||||
|
static bool hasPrefix = false;
|
||||||
|
|
||||||
void DebugWindow::startLogRecording()
|
void DebugWindow::startLogRecording()
|
||||||
{
|
{
|
||||||
|
@ -170,11 +171,17 @@ namespace MWGui
|
||||||
addChar(c);
|
addChar(c);
|
||||||
if (c == '#')
|
if (c == '#')
|
||||||
addChar(c);
|
addChar(c);
|
||||||
|
if (c == '\n')
|
||||||
|
hasPrefix = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (char c : color)
|
for (char c : color)
|
||||||
addChar(c);
|
addChar(c);
|
||||||
|
if (!hasPrefix)
|
||||||
|
{
|
||||||
addShieldedStr(prefix);
|
addShieldedStr(prefix);
|
||||||
|
hasPrefix = true;
|
||||||
|
}
|
||||||
addShieldedStr(msg);
|
addShieldedStr(msg);
|
||||||
if (bufferOverflow)
|
if (bufferOverflow)
|
||||||
sLogStartIndex = (sLogEndIndex + 1) % bufSize;
|
sLogStartIndex = (sLogEndIndex + 1) % bufSize;
|
||||||
|
|
Loading…
Reference in a new issue