From 92a67c73057aa0fb968fc7d5a7115ca205f84a17 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 17 Feb 2021 01:32:08 +0100 Subject: [PATCH] remove debug prints of Http for now --- include/Common.h | 18 +++++++++--------- src/Http.cpp | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/Common.h b/include/Common.h index 5fcb8cf..2c1c26c 100644 --- a/include/Common.h +++ b/include/Common.h @@ -76,15 +76,15 @@ static inline void luaprint(const std::string& str) { } */ -#define warn(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [WARN] ") + (x)); -#define info(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [INFO] ") + (x)); -#define error(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [ERROR] ") + (x)); -#define luaprint(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [LUA] ") + (x)); -#define debug(x) \ - do { \ - if (Application::Settings.DebugModeEnabled) { \ - Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [DEBUG] ") + (x)) \ - } \ +#define warn(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [WARN] ") + (x)) +#define info(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [INFO] ") + (x)) +#define error(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [ERROR] ") + (x)) +#define luaprint(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [LUA] ") + (x)) +#define debug(x) \ + do { \ + if (Application::Settings.DebugModeEnabled) { \ + Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [DEBUG] ") + (x)); \ + } \ } while (false) #define Biggest 30000 diff --git a/src/Http.cpp b/src/Http.cpp index 890c6d1..b3417b7 100644 --- a/src/Http.cpp +++ b/src/Http.cpp @@ -1,6 +1,6 @@ #include "Http.h" -#include "Common.h" +//#include "Common.h" #include #include #include @@ -47,7 +47,7 @@ std::string Http::GET(const std::string& host, int port, const std::string& targ return result; } catch (const std::exception& e) { - error(e.what()); + //error(e.what()); return "-1"; } } @@ -71,7 +71,7 @@ std::string Http::POST(const std::string& host, const std::string& target, const boost::system::error_code ec { static_cast(::ERR_get_error()), boost::asio::error::get_ssl_category() }; // FIXME: we could throw and crash, if we like // throw boost::system::system_error { ec }; - debug("POST " + host + target + " failed."); + //debug("POST " + host + target + " failed."); return false; } beast::get_lowest_layer(stream).connect(results); @@ -85,7 +85,7 @@ std::string Http::POST(const std::string& host, const std::string& target, const //debug("IPv6 connect failed, trying IPv4"); bool ok = try_connect_with_protocol(tcp::v4()); if (!ok) { - error("failed to resolve or connect in POST " + host + target); + //error("failed to resolve or connect in POST " + host + target); return "-1"; } //} @@ -133,11 +133,11 @@ std::string Http::POST(const std::string& host, const std::string& target, const // info(result.str()); std::string debug_response_str; std::getline(result, debug_response_str); - debug("POST " + host + target + ": " + debug_response_str); + //debug("POST " + host + target + ": " + debug_response_str); return std::string(response.body()); } catch (const std::exception& e) { - error(e.what()); + //error(e.what()); return "-1"; } } \ No newline at end of file