Sentry: add multiple more logging mechanisms, add [CHAT]

This commit is contained in:
Lion Kortlepel
2021-08-11 14:12:47 +02:00
committed by Lion
parent 5330013dc3
commit 8fada3ac04
11 changed files with 106 additions and 42 deletions

View File

@@ -124,15 +124,16 @@ std::string Http::POST(const std::string& host, const std::string& target, const
http::read(stream, buffer, response);
Sentry.SetExtra("reponse-code", std::to_string(response.result_int()));
std::unordered_map<std::string, std::string> response_data;
response_data["reponse-code"] = std::to_string(response.result_int());
for (const auto& header : response.base()) {
// need to do explicit casts to convert string_view to string
// since string_view may not be null-terminated (and in fact isn't, here)
std::string KeyString(header.name_string());
std::string ValueString(header.value());
Sentry.SetExtra(KeyString, ValueString);
response_data[KeyString] = ValueString;
}
Sentry.SetContext("https-post-data", response_data);
std::stringstream result;
result << response;