MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / rmExpiredLogs

Function rmExpiredLogs

src/framework/log/codetimecheck.cpp:39–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37#endif
38
39 static void rmExpiredLogs()
40 {
41 QtConcurrent::run([=](){
42 QDirIterator itera(LogUtils::appCacheLogPath()
43 + QDir::separator() + tcDirName);
44 while(itera.hasNext()) {
45 itera.next();
46 auto list = itera.fileName().split("_");
47 if (itera.fileInfo().suffix() == "csv"
48 && list.count() == 3
49 && !LogUtils::containLastDay(
50 QDateTime(QDate::fromString(list[0],"yyyy-MM-dd"),
51 QTime(0,0,0,0)),
52 LogUtils::toDayZero(),
53 GlobalPrivate::dayCount))
54 {
55 qInfo("remove true(%d) not last week log: %s",
56 QDir().remove(itera.path() + QDir::separator() + itera.fileName()),
57 itera.fileName().toLocal8Bit().data());
58 }
59 }
60 });
61 }
62
63 static void outCheck(const QMessageLogContext &context, const QString &msg)
64 {

Callers 1

outCheckFunction · 0.70

Calls 6

fileNameMethod · 0.80
nextMethod · 0.45
countMethod · 0.45
removeMethod · 0.45
pathMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected