mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-23 21:05:44 +03:00
Merge pull request #5580 from nextcloud/bugfix/log-sizes
Enter next log file if the current log file is larger than 512 KB
This commit is contained in:
commit
3860a4cc6c
1 changed files with 6 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
|
||||
namespace {
|
||||
constexpr int CrashLogSize = 20;
|
||||
constexpr int MaxLogSizeBytes = 1024 * 512;
|
||||
}
|
||||
namespace OCC {
|
||||
|
||||
|
@ -117,9 +118,14 @@ void Logger::doLog(QtMsgType type, const QMessageLogContext &ctx, const QString
|
|||
cout << msg << endl;
|
||||
#endif
|
||||
{
|
||||
if (_logFile.size() >= MaxLogSizeBytes) {
|
||||
enterNextLogFile();
|
||||
}
|
||||
|
||||
QMutexLocker lock(&_mutex);
|
||||
_crashLogIndex = (_crashLogIndex + 1) % CrashLogSize;
|
||||
_crashLog[_crashLogIndex] = msg;
|
||||
|
||||
if (_logstream) {
|
||||
(*_logstream) << msg << Qt::endl;
|
||||
if (_doFileFlush)
|
||||
|
|
Loading…
Reference in a new issue