Version: 2.1 (using KDE 3.5.5, Kubuntu (edgy) 4:3.5.5-0ubuntu3.1) Compiler: Target: i486-linux-gnu OS: Linux (i686) release 2.6.17-11-generic After some time in use Ktorrent log file got to 90 MB size. I could not find an option to limit the size it can grow to, so I think there must be some option created in the configuration dialogs.
We will add an automatic log rotate after 10 MB, don't see much need in actually having this configurable.
SVN commit 666273 by guisson: Auto rotate log when it gets larger then 10 MB BUG: 142496 M +17 -2 log.cpp --- trunk/extragear/network/ktorrent/libktorrent/util/log.cpp #666272:666273 @@ -38,6 +38,8 @@ namespace bt { + const Uint32 MAX_LOG_FILE_SIZE = 10 * 1024 * 1024; // 10 MB + class Log::Private { public: @@ -103,8 +105,8 @@ { tmp += line; } - - void endline() + + void finishLine() { *out << QDateTime::currentDateTime().toString() << ": " << tmp << ::endl; fptr.flush(); @@ -123,6 +125,19 @@ } tmp = ""; } + + void endline() + { + finishLine(); + if (fptr.size() > MAX_LOG_FILE_SIZE) + { + // calling setOutputFile will rotate the logs + tmp = "Log larger then 10 MB, rotating"; + finishLine(); + QString file = fptr.name(); + setOutputFile(file); + } + } }; Log::Log()