mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-20 02:53:53 +00:00
Split long osg log messages into lines.
This commit is contained in:
parent
dc82cb61f4
commit
7d551b0cfd
1 changed files with 13 additions and 1 deletions
|
@ -254,7 +254,19 @@ namespace
|
||||||
level = Debug::Debug;
|
level = Debug::Debug;
|
||||||
}
|
}
|
||||||
std::string_view s(msgCopy);
|
std::string_view s(msgCopy);
|
||||||
Log(level) << (s.back() == '\n' ? s.substr(0, s.size() - 1) : s);
|
if (s.size() < 1024)
|
||||||
|
Log(level) << (s.back() == '\n' ? s.substr(0, s.size() - 1) : s);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (!s.empty())
|
||||||
|
{
|
||||||
|
size_t lineSize = 1;
|
||||||
|
while (lineSize < s.size() && s[lineSize - 1] != '\n')
|
||||||
|
lineSize++;
|
||||||
|
Log(level) << s.substr(0, s[lineSize - 1] == '\n' ? lineSize - 1 : lineSize);
|
||||||
|
s = s.substr(lineSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue