projects
/
nextcloud-desktop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0a5771
)
Enter next log file if the current log file is larger than 512 KB when writing log...
author
Claudio Cambra
<claudio.cambra@nextcloud.com>
Thu, 6 Apr 2023 13:18:10 +0000
(21:18 +0800)
committer
Matthieu Gallien
<matthieu_gallien@yahoo.fr>
Tue, 11 Apr 2023 21:10:03 +0000
(23:10 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/libsync/logger.cpp
patch
|
blob
|
history
diff --git
a/src/libsync/logger.cpp
b/src/libsync/logger.cpp
index 405266aea584a2eca304c9fbd1d7235e297b33a6..fe8acf25e7e935fd16b20f3907a2efc1adbbad0d 100644
(file)
--- a/
src/libsync/logger.cpp
+++ b/
src/libsync/logger.cpp
@@
-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)