From 55000c76535f0eb8a0e4515a3b4844392f4dadf4 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 21 Dec 2015 10:02:05 +0100 Subject: [PATCH] Remove debugging --- ArchiSteamFarm/Bot.cs | 15 --------------- ArchiSteamFarm/CardsFarmer.cs | 14 -------------- ArchiSteamFarm/Logging.cs | 2 +- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 3991908f6..dd180efe4 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -105,9 +105,7 @@ namespace ArchiSteamFarm { } internal Bot(string botName) { - Logging.LogGenericDebug(botName, "Created new bot object: " + ToString()); if (Bots.ContainsKey(botName)) { - Logging.LogGenericDebug(botName, "But that name is already in use, so returning!"); return; } @@ -340,9 +338,7 @@ namespace ArchiSteamFarm { } internal async Task Start() { - Logging.LogGenericDebug(BotName, "Got signal to start!"); if (IsRunning) { - Logging.LogGenericDebug(BotName, "But it's started already, so returning"); return; } @@ -354,24 +350,17 @@ namespace ArchiSteamFarm { } IsRunning = true; - Logging.LogGenericDebug(BotName, "Connecting steam client!"); SteamClient.Connect(); - - Logging.LogGenericDebug(BotName, "Turned on callback handle!"); var fireAndForget = Task.Run(() => HandleCallbacks()); } internal async Task Stop() { - Logging.LogGenericDebug(BotName, "Got signal to stop"); if (!IsRunning) { - Logging.LogGenericDebug(BotName, "But it's stopped already, so returning"); return; } - Logging.LogGenericDebug(BotName, "Stopping CF module..."); await CardsFarmer.StopFarming().ConfigureAwait(false); IsRunning = false; - Logging.LogGenericDebug(BotName, "Disconnecting steam client!"); SteamClient.Disconnect(); } @@ -400,12 +389,10 @@ namespace ArchiSteamFarm { } private void HandleCallbacks() { - Logging.LogGenericDebug(BotName, "Started Loop"); TimeSpan timeSpan = TimeSpan.FromMilliseconds(CallbackSleep); while (IsRunning) { CallbackManager.RunWaitCallbacks(timeSpan); } - Logging.LogGenericDebug(BotName, "Stopped Loop"); } private void SendMessageToUser(ulong steamID, string message) { @@ -652,8 +639,6 @@ namespace ArchiSteamFarm { return; } - Logging.LogGenericDebug(BotName, "Got command: " + message); - if (!message.Contains(" ")) { switch (message) { case "!2fa": diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 60da158fe..0ea91919c 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -134,15 +134,10 @@ namespace ArchiSteamFarm { } internal async Task StartFarming() { - Logging.LogGenericDebug(Bot.BotName, "Got signal to start farming, calling StopFarming firstly"); await StopFarming().ConfigureAwait(false); - - Logging.LogGenericDebug(Bot.BotName, "StopFarming done, waiting for semaphore now..."); await Semaphore.WaitAsync().ConfigureAwait(false); - Logging.LogGenericDebug(Bot.BotName, "Got it!"); if (NowFarming) { - Logging.LogGenericDebug(Bot.BotName, "But for some reason farming is already active, probably called in a meantime, so returning!"); Semaphore.Release(); return; } @@ -150,7 +145,6 @@ namespace ArchiSteamFarm { // Check if farming is possible Logging.LogGenericInfo(Bot.BotName, "Checking possibility to farm..."); NowFarming = true; - Logging.LogGenericDebug(Bot.BotName, "Releasing semaphore while waiting!"); Semaphore.Release(); Bot.ArchiHandler.PlayGames(1337); @@ -162,9 +156,7 @@ namespace ArchiSteamFarm { Logging.LogGenericInfo(Bot.BotName, "Farming is possible!"); - Logging.LogGenericDebug(Bot.BotName, "Waiting for semaphore..."); await Semaphore.WaitAsync().ConfigureAwait(false); - Logging.LogGenericDebug(Bot.BotName, "Got it!"); if (await Bot.ArchiWebHandler.ReconnectIfNeeded().ConfigureAwait(false)) { Semaphore.Release(); @@ -308,12 +300,8 @@ namespace ArchiSteamFarm { } internal async Task StopFarming() { - Logging.LogGenericDebug(Bot.BotName, "Got signal to stop farming"); - Logging.LogGenericDebug(Bot.BotName, "Waiting for semaphore"); await Semaphore.WaitAsync().ConfigureAwait(false); - Logging.LogGenericDebug(Bot.BotName, "Got it!"); if (!NowFarming) { - Logging.LogGenericDebug(Bot.BotName, "Farming is already stopped, so returning"); Semaphore.Release(); return; } @@ -326,7 +314,6 @@ namespace ArchiSteamFarm { } FarmResetEvent.Reset(); Logging.LogGenericInfo(Bot.BotName, "Farming stopped!"); - Logging.LogGenericDebug(Bot.BotName, "Releasing semaphore..."); Semaphore.Release(); } @@ -335,7 +322,6 @@ namespace ArchiSteamFarm { return; } - Logging.LogGenericDebug(Bot.BotName, "START!"); await StartFarming().ConfigureAwait(false); } diff --git a/ArchiSteamFarm/Logging.cs b/ArchiSteamFarm/Logging.cs index 87cb0e597..c0d59403c 100644 --- a/ArchiSteamFarm/Logging.cs +++ b/ArchiSteamFarm/Logging.cs @@ -56,7 +56,7 @@ namespace ArchiSteamFarm { Log("[*] NOTICE: " + previousMethodName + "() <" + botName + "> " + message); } - //[Conditional("DEBUG")] + [Conditional("DEBUG")] internal static void LogGenericDebug(string botName, string message, [CallerMemberName] string previousMethodName = "") { Log("[#] DEBUG: " + previousMethodName + "() <" + botName + "> " + message); }