Correct some logging categories

This commit is contained in:
Henrik Rydgård
2026-06-13 17:12:16 +02:00
parent 7c1f052b87
commit 00126e4c6f
6 changed files with 24 additions and 24 deletions
+7 -7
View File
@@ -54,11 +54,11 @@ std::string Connection::GetLocalIpAsString() const {
bool Connection::Resolve(const char *host, int port, DNSType type) {
if ((intptr_t)sock_ != -1) {
ERROR_LOG(Log::IO, "Resolve: Already have a socket");
ERROR_LOG(Log::Net, "Resolve: Already have a socket");
return false;
}
if (!host || port < 1 || port > 65535) {
ERROR_LOG(Log::IO, "Resolve: Invalid host or port (%d)", port);
ERROR_LOG(Log::Net, "Resolve: Invalid host or port (%d)", port);
return false;
}
@@ -76,7 +76,7 @@ bool Connection::Resolve(const char *host, int port, DNSType type) {
std::string err;
if (!net::DNSResolve(processedHostname.c_str(), port_str, &resolved_, err, type)) {
WARN_LOG(Log::IO, "Failed to resolve host '%s': '%s' (%s)", host, err.c_str(), DNSTypeAsString(type));
WARN_LOG(Log::Net, "Failed to resolve host '%s': '%s' (%s)", host, err.c_str(), DNSTypeAsString(type));
// Zero port so that future calls fail.
port_ = 0;
return false;
@@ -99,7 +99,7 @@ static void FormatAddr(char *addrbuf, size_t bufsize, const addrinfo *info) {
bool Connection::Connect(int maxTries, double timeout, bool *cancelConnect) {
if (port_ <= 0) {
ERROR_LOG(Log::IO, "Bad port");
ERROR_LOG(Log::Net, "Bad port");
return false;
}
sock_ = -1;
@@ -115,13 +115,13 @@ bool Connection::Connect(int maxTries, double timeout, bool *cancelConnect) {
int sock = socket(possible->ai_family, SOCK_STREAM, IPPROTO_TCP);
if ((intptr_t)sock == -1) {
ERROR_LOG(Log::IO, "Bad socket");
ERROR_LOG(Log::Net, "Bad socket");
continue;
}
// Windows sockets aren't limited by socket number, just by count, so checking FD_SETSIZE there is wrong.
#if !PPSSPP_PLATFORM(WINDOWS)
if (sock >= FD_SETSIZE) {
ERROR_LOG(Log::IO, "Socket doesn't fit in FD_SET: %d We probably have a leak.", sock);
ERROR_LOG(Log::Net, "Socket doesn't fit in FD_SET: %d We probably have a leak.", sock);
closesocket(sock);
continue;
}
@@ -194,7 +194,7 @@ bool Connection::Connect(int maxTries, double timeout, bool *cancelConnect) {
}
if (cancelConnect && *cancelConnect) {
WARN_LOG(Log::HTTP, "connect: cancelled (2): %s:%d", host_.c_str(), port_);
WARN_LOG(Log::Net, "connect: cancelled (2): %s:%d", host_.c_str(), port_);
break;
}
+5 -5
View File
@@ -31,7 +31,7 @@ bool RequestHeader::GetParamValue(const char *param_name, std::string *value) co
for (size_t i = 0; i < v.size(); i++) {
std::vector<std::string_view> parts;
SplitString(v[i], '=', parts);
DEBUG_LOG(Log::IO, "Param: %.*s Value: %.*s", (int)parts[0].size(), parts[0].data(), (int)parts[1].size(), parts[1].data());
DEBUG_LOG(Log::HTTP, "Param: %.*s Value: %.*s", (int)parts[0].size(), parts[0].data(), (int)parts[1].size(), parts[1].data());
if (parts[0] == param_name) {
*value = parts[1];
return true;
@@ -119,13 +119,13 @@ int RequestHeader::ParseHttpHeader(const char *buffer) {
if (!strncasecmp(key, "User-Agent", key_len)) {
user_agent = new char[value_len + 1];
memcpy(user_agent, buffer, value_len + 1);
VERBOSE_LOG(Log::IO, "user-agent: %s", user_agent);
VERBOSE_LOG(Log::HTTP, "user-agent: %s", user_agent);
} else if (!strncasecmp(key, "Referer", key_len)) {
referer = new char[value_len + 1];
memcpy(referer, buffer, value_len + 1);
} else if (!strncasecmp(key, "Content-Length", key_len)) {
content_length = atoi(buffer);
VERBOSE_LOG(Log::IO, "Content-Length: %i", (int)content_length);
VERBOSE_LOG(Log::HTTP, "Content-Length: %i", (int)content_length);
} else {
std::string key_str(key, key_len);
std::transform(key_str.begin(), key_str.end(), key_str.begin(), tolower);
@@ -148,12 +148,12 @@ void RequestHeader::ParseHeaders(net::InputSink *sink) {
line_count++;
if (type == SIMPLE) {
// Done!
VERBOSE_LOG(Log::IO, "Simple: Done parsing http request.");
VERBOSE_LOG(Log::HTTP, "Simple: Done parsing http request.");
break;
}
}
VERBOSE_LOG(Log::IO, "finished parsing request.");
VERBOSE_LOG(Log::HTTP, "finished parsing request.");
ok = line_count > 1 && resource != nullptr;
}
+9 -9
View File
@@ -61,7 +61,7 @@ void HTTPSRequest::Join() {
res_ = nullptr;
req_ = nullptr;
} else {
ERROR_LOG(Log::IO, "HTTPSDownload::Join not implemented");
ERROR_LOG(Log::HTTP, "HTTPSDownload::Join not implemented");
}
}
@@ -88,22 +88,22 @@ bool HTTPSRequest::Done() {
// It's a naett error. Translate and handle.
switch (resultCode_) {
case naettConnectionError: // -1
ERROR_LOG(Log::IO, "Connection error");
ERROR_LOG(Log::HTTP, "Connection error");
break;
case naettProtocolError: // -2
ERROR_LOG(Log::IO, "Protocol error");
ERROR_LOG(Log::HTTP, "Protocol error");
break;
case naettReadError: // -3
ERROR_LOG(Log::IO, "Read error");
ERROR_LOG(Log::HTTP, "Read error");
break;
case naettWriteError: // -4
ERROR_LOG(Log::IO, "Write error");
ERROR_LOG(Log::HTTP, "Write error");
break;
case naettGenericError: // -5
ERROR_LOG(Log::IO, "Generic error");
ERROR_LOG(Log::HTTP, "Generic error");
break;
default:
ERROR_LOG(Log::IO, "Unhandled naett error %d", resultCode_);
ERROR_LOG(Log::HTTP, "Unhandled naett error %d", resultCode_);
break;
}
failed_ = true;
@@ -111,11 +111,11 @@ bool HTTPSRequest::Done() {
} else if (resultCode_ == 200) {
bool clear = !(flags_ & RequestFlags::KeepInMemory);
if (!outfile_.empty() && !buffer_.FlushToFile(outfile_, clear)) {
ERROR_LOG(Log::IO, "Failed writing download to '%s'", outfile_.c_str());
ERROR_LOG(Log::HTTP, "Failed writing download to '%s'", outfile_.c_str());
}
progress_.Update(bodyLength, bodyLength, true);
} else {
WARN_LOG(Log::IO, "Naett request failed: %d", resultCode_);
WARN_LOG(Log::HTTP, "Naett request failed: %d", resultCode_);
failed_ = true;
progress_.Update(0, 0, true);
}
+1 -1
View File
@@ -209,7 +209,7 @@ void InputSink::AccountFill(int bytes) {
int err = socket_errno;
if (err == EWOULDBLOCK || err == EAGAIN)
return;
ERROR_LOG(Log::IO, "Error reading from socket: %d", err);
ERROR_LOG(Log::Net, "Error reading from socket: %d", err);
return;
}
+1 -1
View File
@@ -34,7 +34,7 @@ void UrlEncoder::AppendEscaped(const std::string &value)
void Url::Split() {
size_t colonSlashSlash = url_.find("://");
if (colonSlashSlash == std::string::npos) {
ERROR_LOG(Log::IO, "Invalid URL: %s", url_.c_str());
ERROR_LOG(Log::Net, "Invalid URL: %s", url_.c_str());
return;
}
+1 -1
View File
@@ -212,7 +212,7 @@ bool LoadDNSForGameID(std::string_view gameID, std::string_view jsonStr, InfraDN
json::JsonReader reader(jsonStr.data(), jsonStr.length());
if (!reader.ok() || !reader.root()) {
ERROR_LOG(Log::IO, "Error parsing DNS JSON");
ERROR_LOG(Log::sceNet, "Error parsing DNS JSON");
return false;
}