Add Logging for HTTP Start Requests (#3667)

This commit is contained in:
Arthur 2024-09-07 14:59:32 +03:00 committed by GitHub
parent 0d18cd6e59
commit b0b56ee4f7
3 changed files with 7 additions and 2 deletions

View File

@ -120,6 +120,7 @@ namespace big
int metric_logs{}; int metric_logs{};
int packet_logs{}; int packet_logs{};
bool http_start_request_logs{};
bool script_hook_logs{}; bool script_hook_logs{};
struct script_event struct script_event
@ -134,7 +135,7 @@ namespace big
NLOHMANN_DEFINE_TYPE_INTRUSIVE(script_event, logs, filter_player, player_id) NLOHMANN_DEFINE_TYPE_INTRUSIVE(script_event, logs, filter_player, player_id)
} script_event{}; } script_event{};
NLOHMANN_DEFINE_TYPE_INTRUSIVE(logs, metric_logs, packet_logs, script_hook_logs, script_event) NLOHMANN_DEFINE_TYPE_INTRUSIVE(logs, metric_logs, packet_logs, http_start_request_logs, script_hook_logs, script_event)
} logs{}; } logs{};
struct fuzzer struct fuzzer

View File

@ -4,6 +4,9 @@ namespace big
{ {
bool hooks::http_start_request(void* request, const char* uri) bool hooks::http_start_request(void* request, const char* uri)
{ {
if (g.debug.logs.http_start_request_logs)
LOG(INFO) << uri;
if (strstr(uri, "Bonus")) [[unlikely]] if (strstr(uri, "Bonus")) [[unlikely]]
{ {
// This is for worst case scenario where a report does slip through the cracks... // This is for worst case scenario where a report does slip through the cracks...

View File

@ -11,6 +11,7 @@ namespace big
static const char* options[]{"OFF"_T.data(), "ALL"_T.data(), "FILTERS"_T.data()}; static const char* options[]{"OFF"_T.data(), "ALL"_T.data(), "FILTERS"_T.data()};
ImGui::Combo("DEBUG_LOG_METRICS"_T.data(), (int*)&g.debug.logs.metric_logs, options, IM_ARRAYSIZE(options)); ImGui::Combo("DEBUG_LOG_METRICS"_T.data(), (int*)&g.debug.logs.metric_logs, options, IM_ARRAYSIZE(options));
ImGui::Combo("VIEW_DEBUG_LOGS_LOG_PACKETS"_T.data(), (int*)&g.debug.logs.packet_logs, options, IM_ARRAYSIZE(options)); ImGui::Combo("VIEW_DEBUG_LOGS_LOG_PACKETS"_T.data(), (int*)&g.debug.logs.packet_logs, options, IM_ARRAYSIZE(options));
ImGui::Checkbox("DEBUG_LOG_HTTP_START_REQUESTS"_T.data(), &g.debug.logs.http_start_request_logs);
ImGui::Checkbox("DEBUG_LOG_NATIVE_SCRIPT_HOOKS"_T.data(), &g.debug.logs.script_hook_logs); ImGui::Checkbox("DEBUG_LOG_NATIVE_SCRIPT_HOOKS"_T.data(), &g.debug.logs.script_hook_logs);
if (ImGui::TreeNode("DEBUG_LOG_TREE_SCRIPT_EVENT"_T.data())) if (ImGui::TreeNode("DEBUG_LOG_TREE_SCRIPT_EVENT"_T.data()))