From 9abd946c21df185bc84ca6fa7d68a95581e9e91e Mon Sep 17 00:00:00 2001 From: houchengqiu Date: Tue, 29 Aug 2023 17:59:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=AA=97=E7=AE=A1=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=B7=AF=E5=BE=84=E5=BA=94=E5=8A=A0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 窗管默认日志日志应加. Log: 窗管默认日志路径应加. --- application/logapplicationhelper.cpp | 4 ++-- application/logexportthread.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/logapplicationhelper.cpp b/application/logapplicationhelper.cpp index 375e9106..aaf4fb66 100644 --- a/application/logapplicationhelper.cpp +++ b/application/logapplicationhelper.cpp @@ -112,12 +112,12 @@ void LogApplicationHelper::initOtherLog() m_other_log_list_temp.append(QStringList() << "iso-customizer-agent.log" << "/root/.cache/isocustomizer-agent/iso-customizer-agent/iso-customizer-agent.log"); m_other_log_list_temp.append(QStringList() << "downloader" << "~/.config/uos/downloader/Log"); - m_other_log_list_temp.append(QStringList() << "kwin.log" << "~/kwin.log"); + m_other_log_list_temp.append(QStringList() << ".kwin.log" << "~/.kwin.log"); m_other_log_list_temp.append(QStringList() << "audit.log" << "/var/log/audit/audit.log"); m_other_log_list_temp.append(QStringList() << "udcp-client" << "/var/log/udcp-client"); //窗管日志和配置文件监视 - m_other_log_list_temp.append(QStringList() << "kwin_x11.log" << "~/kwin_x11.log"); + m_other_log_list_temp.append(QStringList() << ".kwin_x11.log" << "~/.kwin_x11.log"); m_other_log_list_temp.append(QStringList() << "kwinrc" << "~/.config/kwinrc"); m_other_log_list_temp.append(QStringList() << "kglobalshortcutsrc" << "~/.config/kglobalshortcutsrc"); m_other_log_list_temp.append(QStringList() << "kwinrulesrc" << "~/.config/kwinrulesrc"); diff --git a/application/logexportthread.cpp b/application/logexportthread.cpp index 27a3a437..298ae15e 100644 --- a/application/logexportthread.cpp +++ b/application/logexportthread.cpp @@ -3382,6 +3382,7 @@ bool LogExportThread::exportToZip(const QString &fileName, const QList Date: Wed, 30 Aug 2023 14:41:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E6=97=A5=E5=BF=97=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅有coredump文件才从标准输出读取压缩进度,其他时候不读取。 Log: 解决导出崩溃日志失败的问题 Bug: https://pms.uniontech.com/bug-view-217019.html --- application/logexportthread.cpp | 44 +++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/application/logexportthread.cpp b/application/logexportthread.cpp index 298ae15e..43e80d31 100644 --- a/application/logexportthread.cpp +++ b/application/logexportthread.cpp @@ -3359,8 +3359,11 @@ bool LogExportThread::exportToZip(const QString &fileName, const QListexportLog(tmpPath, it.storagePath, true); + if (it.coreFile == "present") + nCoreDumpCount++; if (!m_canRunning) { break; } @@ -3378,26 +3381,31 @@ bool LogExportThread::exportToZip(const QString &fileName, const QList lines = QString(dd).split('\n', QString::SkipEmptyParts); - for (const QString &line : qAsConst(lines)) { - int pos = line.indexOf(QLatin1Char('%')); - if (pos > 1) { - int percentage = line.midRef(pos - 3, 3).toInt(); - sigProgress(percentage, 100); + // 有coredump文件,才读取压缩进度 + if (nCoreDumpCount > 0) { + connect(&procss, &QProcess::readyReadStandardOutput, this, [&](){ + if (!m_canRunning) { + procss.kill(); + ret = false; + return; } - } + + qInfo() << "recive proces done.."; + QByteArray dd = procss.readAllStandardOutput(); + QList lines = QString(dd).split('\n', QString::SkipEmptyParts); + for (const QString &line : qAsConst(lines)) { + int pos = line.indexOf(QLatin1Char('%')); + if (pos > 1) { + int percentage = line.midRef(pos - 3, 3).toInt(); + sigProgress(percentage, 100); + } + } + ret = true; + }); + } else { ret = true; - qDebug() << "route process slot ret:" << ret; - }); + } + procss.start("/bin/bash", arg); procss.waitForFinished(-1);