Skip to content

Commit

Permalink
feat: print some more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Apr 25, 2024
1 parent 0446e72 commit dfca0a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ipdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool IPDB::LookUpIPCityInfo(

MMDB_lookup_result_s city_result = MMDB_lookup_sockaddr(&CityDB, ip_address, &mmdbStatus);
if (mmdbStatus != MMDB_SUCCESS) {
qWarning() << "Failed to search from database with error: "
qWarning() << "Failed to search from City database with error: "
<< MMDB_strerror(mmdbStatus);
return false;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ bool IPDB::LookUpIPCityInfo(
// 查询失败,没找到结果,可能是本地地址
char ipAddressPrintBuf[INET6_ADDRSTRLEN];
PrintIPAddress((sockaddr_storage *)ip_address, ipAddressPrintBuf);
qWarning() << "No entry found for IP:" << ipAddressPrintBuf;
qWarning() << "No City entry found for IP:" << ipAddressPrintBuf;
cityName = QString("私有地址");
countryName = QString("");
// 其实是无效的
Expand All @@ -203,7 +203,7 @@ bool IPDB::LookUpIPISPInfo(
int mmdbStatus;
MMDB_lookup_result_s isp_result = MMDB_lookup_sockaddr(&ISPDB, ip_address, &mmdbStatus);
if (mmdbStatus != MMDB_SUCCESS) {
qWarning() << "Failed to search from database with error: "
qWarning() << "Failed to search from ISP database with error: "
<< MMDB_strerror(mmdbStatus);
return false;
}
Expand Down Expand Up @@ -291,7 +291,7 @@ bool IPDB::LookUpIPISPInfo(
// 查询失败,没找到结果,可能是本地地址
char ipAddressPrintBuf[INET6_ADDRSTRLEN];
PrintIPAddress((sockaddr_storage *)ip_address, ipAddressPrintBuf);
qWarning() << "No entry found for IP:" << ipAddressPrintBuf;
qWarning() << "No ISP entry found for IP:" << ipAddressPrintBuf;
isp = QString("私有地址");
org = QString("");
asOrg = QString("");
Expand Down
5 changes: 5 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ int main(int argc, char *argv[])

// 如果文件存在则应用主题
if (styleFile.exists()) {
// 应用主题
qInfo() << "Applying theme stylesheets...";

// 添加图标目录
QDir::addSearchPath("icon", "theme/icon");
Expand All @@ -106,6 +108,9 @@ int main(int argc, char *argv[])

// 应用样式表
app.setStyleSheet(styleSheet);
} else {
// 没有主题
qInfo() << "No theme found, start with default UI.";
}

// 初始化主窗口
Expand Down
4 changes: 2 additions & 2 deletions nyatrace_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ void NyaTraceGUI::CleanUpResolving(const bool isSucceeded) {
ui->statusbar->showMessage(QString("解析完成,耗时 %1 %2。").arg(consumedTime).arg(isTimeMilliseconds ? "毫秒" : ""));
} // 否则失败了,不要去动失败的提示信息

qDebug() << "CleanUp finished";
qDebug() << "Resolve clean-up finished";

}

Expand Down Expand Up @@ -471,7 +471,7 @@ void NyaTraceGUI::CleanUpTracing(const bool isSucceeded) {
}
} // 否则失败了,不要去动失败的提示信息

qDebug() << "CleanUp finished";
qDebug() << "Tracing clean-up finished";
}


Expand Down

0 comments on commit dfca0a1

Please sign in to comment.