From 05bfac0ef00c748a959a2a52c4638aa65a2b7f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 19 Dec 2020 19:34:43 +0100 Subject: [PATCH] Misc logging improvements --- Common/Net/HTTPClient.cpp | 17 +++++++++++++++-- GPU/Common/FramebufferManagerCommon.cpp | 18 +++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Common/Net/HTTPClient.cpp b/Common/Net/HTTPClient.cpp index 41cf350625..b8be625400 100644 --- a/Common/Net/HTTPClient.cpp +++ b/Common/Net/HTTPClient.cpp @@ -48,6 +48,19 @@ inline unsigned short myhtons(unsigned short x) { return (x >> 8) | (x << 8); } +const char *DNSTypeAsString(DNSType type) { + switch (type) { + case DNSType::IPV4: + return "IPV4"; + case DNSType::IPV6: + return "IPV6"; + case DNSType::ANY: + return "ANY"; + default: + return "N/A"; + } +} + bool Connection::Resolve(const char *host, int port, DNSType type) { if ((intptr_t)sock_ != -1) { ERROR_LOG(IO, "Resolve: Already have a socket"); @@ -66,8 +79,8 @@ bool Connection::Resolve(const char *host, int port, DNSType type) { std::string err; if (!net::DNSResolve(host, port_str, &resolved_, err, type)) { - ERROR_LOG(IO, "Failed to resolve host %s: %s", host, err.c_str()); - // So that future calls fail. + WARN_LOG(IO, "Failed to resolve host '%s': '%s' (%s)", host, err.c_str(), DNSTypeAsString(type)); + // Zero port so that future calls fail. port_ = 0; return false; } diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index f7cdc5f765..fac716dc48 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -1738,10 +1738,10 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst if (dstBuffer && srcBuffer) { if (srcBuffer == dstBuffer) { if (srcX != dstX || srcY != dstY) { - WARN_LOG_N_TIMES(dstsrc, 100, G3D, "Intra-buffer block transfer %08x (x:%d y:%d stride:%d) -> %08x (x:%d y:%d stride:%d) (%dx%d %dbpp)", + WARN_LOG_N_TIMES(dstsrc, 100, G3D, "Intra-buffer block transfer %dx%d %dbpp from %08x (x:%d y:%d stride:%d) -> %08x (x:%d y:%d stride:%d)", + width, height, bpp, srcBasePtr, srcX, srcY, srcStride, - dstBasePtr, dstX, dstY, dstStride, - width, height, bpp); + dstBasePtr, dstX, dstY, dstStride); FlushBeforeCopy(); // Some backends can handle blitting within a framebuffer. Others will just have to deal with it or ignore it, apparently. BlitFramebuffer(dstBuffer, dstX, dstY, srcBuffer, srcX, srcY, dstWidth, dstHeight, bpp, "Blit_IntraBufferBlockTransfer"); @@ -1753,10 +1753,10 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst return true; // Skip the memory copy. } } else { - WARN_LOG_N_TIMES(dstnotsrc, 100, G3D, "Inter-buffer block transfer %08x (x:%d y:%d stride:%d) -> %08x (x:%d y:%d stride:%d) (%dx%d %dbpp)", + WARN_LOG_N_TIMES(dstnotsrc, 100, G3D, "Inter-buffer block transfer %dx%d %dbpp from %08x (x:%d y:%d stride:%d) -> %08x (x:%d y:%d stride:%d)", + width, height, bpp, srcBasePtr, srcX, srcY, srcStride, - dstBasePtr, dstX, dstY, dstStride, - width, height, bpp); + dstBasePtr, dstX, dstY, dstStride); // Straightforward blit between two framebuffers. FlushBeforeCopy(); BlitFramebuffer(dstBuffer, dstX, dstY, srcBuffer, srcX, srcY, dstWidth, dstHeight, bpp, "Blit_InterBufferBlockTransfer"); @@ -1769,10 +1769,10 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst // Here we should just draw the pixels into the buffer. Copy first. return false; } else if (srcBuffer) { - WARN_LOG_N_TIMES(btd, 100, G3D, "Block transfer readback %08x (x:%d y:%d stride:%d) -> %08x (x:%d y:%d stride:%d) (%dx%d %dbpp)", + WARN_LOG_N_TIMES(btd, 100, G3D, "Block transfer readback %dx%d %dbpp from %08x (x:%d y:%d stride:%d) -> %08x (x:%d y:%d stride:%d)", + width, height, bpp, srcBasePtr, srcX, srcY, srcStride, - dstBasePtr, dstX, dstY, dstStride, - width, height, bpp); + dstBasePtr, dstX, dstY, dstStride); FlushBeforeCopy(); if (g_Config.bBlockTransferGPU && !srcBuffer->memoryUpdated) { const int srcBpp = srcBuffer->format == GE_FORMAT_8888 ? 4 : 2;