Skip to content

Commit

Permalink
Enable enhanced logging when Debug is enabled, #176
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Mar 22, 2016
1 parent 687b20b commit 2fe8db7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ArchiSteamFarm/WebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,16 @@ private static async Task<HttpResponseMessage> UrlRequest(string request, HttpMe
}
}

if (responseMessage == null || !responseMessage.IsSuccessStatusCode) {
if (responseMessage == null) {
return null;
}

if (!responseMessage.IsSuccessStatusCode) {
if (Program.GlobalConfig.Debug) {
Logging.LogGenericError("Request: " + request + "failed!");
Logging.LogGenericError("Status code: " + responseMessage.StatusCode);
Logging.LogGenericError("Content: " + await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false));
}
return null;
}

Expand Down

0 comments on commit 2fe8db7

Please sign in to comment.