Skip to content

Commit

Permalink
fix: unvail "error" log output
Browse files Browse the repository at this point in the history
 due to app_error list

Log:  modify "error" to unsucess in logdata
  • Loading branch information
jeffshuai committed Aug 1, 2024
1 parent 9ae5209 commit 63817d4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions deepin-system-monitor-main/3rdparty/include/closestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ close_stdout(void)
{
if (flush_standard_stream(stdout) != 0 && !(errno == EPIPE)) {
if (errno)
warn(_("write error"));
warn(_("write unsuccess"));
else
warnx(_("write error"));
warnx(_("write unsuccess"));
_exit(CLOSE_EXIT_CODE);
}

Expand Down
2 changes: 1 addition & 1 deletion deepin-system-monitor-main/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace error {

inline void print_errno(decltype(errno) e, const QString msg)

Check warning on line 149 in deepin-system-monitor-main/common/common.h

View workflow job for this annotation

GitHub Actions / cppcheck

Parameter 'msg' is passed by value. It could be passed as a const reference which is usually faster and recommended in C++.
{
qCWarning(app) << QString("Error: [%1] %2, ").arg(e).arg(strerror(e)) << msg;
qCWarning(app) << QString("unsuccess: [%1] %2, ").arg(e).arg(strerror(e)) << msg;
}

} // namespace error
Expand Down
4 changes: 2 additions & 2 deletions deepin-system-monitor-main/dbus/dbusalarmnotify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ void DBusAlarmNotify::showAlarmNotify(QString topic, QString msg, int timeout)
QDBusMessage replyMsg = QDBusConnection::sessionBus().call(ddeNotify);

if (replyMsg.type() == QDBusMessage::ErrorMessage) {
qCWarning(app) << __FUNCTION__ << __LINE__ << ", dde notify dbus method call fail , error name :"
<< replyMsg.errorName() << " , error msg :" << replyMsg.errorMessage();
qCWarning(app) << __FUNCTION__ << __LINE__ << ", dde notify dbus method call unsuccess , unsuccess name :"
<< replyMsg.errorName() << " , unsuccess msg :" << replyMsg.errorMessage();
QString cmd = QString("gdbus call -e -d org.deepin.SystemMonitorDaemon -o /org/deepin/SystemMonitorDaemon -m org.deepin.SystemMonitorDaemon.setAlaramLastTimeInterval 0");
QProcess::startDetached(cmd);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ void SystemProtectionSetting::onMessgaeSetting(QVariant value)
QDBusMessage replyMsg = QDBusConnection::sessionBus().call(showDDEControlCenterPage);

if (replyMsg.type() == QDBusMessage::ErrorMessage) {
qCWarning(app) << __FUNCTION__ << __LINE__ << ", dde control center dbus method call fail , error name :"
qCWarning(app) << __FUNCTION__ << __LINE__ << ", dde control center dbus method call unsuccess , unsuccess name :"
<< replyMsg.errorName() << " , error msg :" << replyMsg.errorMessage();
}

Expand Down Expand Up @@ -514,7 +514,7 @@ void SystemProtectionSetting::onMessgaeSetting(QVariant value)
QDBusMessage replyMsg = QDBusConnection::sessionBus().call(showDDEControlCenter);

if (replyMsg.type() == QDBusMessage::ErrorMessage) {
qCWarning(app) << __FUNCTION__ << __LINE__ << ", dde control center dbus method call fail , error name :"
qCWarning(app) << __FUNCTION__ << __LINE__ << ", dde control center dbus method call unsuccess , unsuccess name :"
<< replyMsg.errorName() << " , error msg :" << replyMsg.errorMessage();
}
}
Expand Down
2 changes: 1 addition & 1 deletion deepin-system-monitor-main/service/service_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static bool setServiceEnable(const QString &servieName, bool enable, QString &er
}

if (!errorString.isEmpty()) {
qCWarning(app) << QString("Set service %1 failed, error %1").arg(enable ? "enable" : "disable").arg(errorString);
qCWarning(app) << QString("Set service %1 failed, unsuccess %1").arg(enable ? "enable" : "disable").arg(errorString);
return false;
} else {
qCDebug(app) << QString("Set service %1 ret: %2").arg(enable ? "enable" : "disable").arg(retMsg.value());
Expand Down
2 changes: 1 addition & 1 deletion deepin-system-monitor-main/system/netif_packet_capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool NetifPacketCapture::hasDevIP()
//获取网络IP(IPv4)
if (ioctl(sockfd, SIOCGIFADDR, &ifr) == -1) {
close(sockfd);
//qCDebug(app)<<"ioctl error!";
//qCDebug(app)<<"ioctl unsuccess!";
return false;
}

Expand Down
5 changes: 4 additions & 1 deletion helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once
#include "ddlog.h"

#include <DSysInfo>
#include <QDebug>

using namespace DDLog;

namespace common{

class SystemState {
Expand Down Expand Up @@ -148,7 +151,7 @@ static inline const SystemState &systemInfo()
static SystemState *state = nullptr;
if (!state) {
const auto version = DTK_CORE_NAMESPACE::DSysInfo::majorVersion();
qInfo() << "Running desktop environment version is:" << version << ", versionNumber:" << version.toLong();
qCInfo(app) << "Running desktop environment version is:" << version << ", versionNumber:" << version.toLong();
if (!version.isEmpty() && version.toLong() <= 20) {
state = new V20SystemState();
state->updateVersion(true);
Expand Down

0 comments on commit 63817d4

Please sign in to comment.