mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Misc
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user