This commit is contained in:
JustArchi
2017-01-31 09:08:53 +01:00
parent b148c41147
commit a61a70c27e
3 changed files with 9 additions and 4 deletions

View File

@@ -771,7 +771,10 @@ namespace ArchiSteamFarm {
TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep);
while (KeepRunning || SteamClient.IsConnected) {
if (!CallbackSemaphore.Wait(0)) {
ArchiLogger.LogGenericDebug(string.Format(Strings.WarningFailedWithError, nameof(CallbackSemaphore)));
if (Debugging.IsUserDebugging) {
ArchiLogger.LogGenericDebug(string.Format(Strings.WarningFailedWithError, nameof(CallbackSemaphore)));
}
return;
}
@@ -814,7 +817,7 @@ namespace ArchiSteamFarm {
HeartBeatFailures = 0;
Statistics?.OnHeartBeat().Forget();
} catch (Exception e) {
if (Debugging.IsDebugBuild || Program.GlobalConfig.Debug) {
if (Debugging.IsUserDebugging) {
ArchiLogger.LogGenericDebugException(e);
}

View File

@@ -35,6 +35,8 @@ namespace ArchiSteamFarm {
internal static readonly bool IsDebugBuild = false;
#endif
internal static bool IsUserDebugging => IsDebugBuild || Program.GlobalConfig.Debug;
internal sealed class DebugListener : IDebugListener {
public void WriteLine(string category, string msg) {
if (string.IsNullOrEmpty(category) && string.IsNullOrEmpty(msg)) {

View File

@@ -517,7 +517,7 @@ namespace ArchiSteamFarm {
responseMessage = await HttpClient.SendAsync(requestMessage).ConfigureAwait(false);
} catch (Exception e) {
// This exception is really common, don't bother with it unless debug mode is enabled
if (Debugging.IsDebugBuild || Program.GlobalConfig.Debug) {
if (Debugging.IsUserDebugging) {
ArchiLogger.LogGenericDebugException(e);
}
@@ -533,7 +533,7 @@ namespace ArchiSteamFarm {
return responseMessage;
}
if (Debugging.IsDebugBuild || Program.GlobalConfig.Debug) {
if (Debugging.IsUserDebugging) {
ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
ArchiLogger.LogGenericDebug(string.Format(Strings.StatusCode, responseMessage.StatusCode));
ArchiLogger.LogGenericDebug(string.Format(Strings.Content, await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false)));