mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-04 16:10:08 +00:00
Integrate DebugListener with Logger
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -172,7 +171,6 @@ namespace ArchiSteamFarm {
|
||||
LogGenericError(nullObjectName + " is null!", botName, previousMethodName);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
internal static void LogGenericDebug(string message, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||
if (string.IsNullOrEmpty(message)) {
|
||||
|
||||
@@ -126,9 +126,10 @@ namespace ArchiSteamFarm {
|
||||
Directory.Delete(SharedInfo.DebugDirectory, true);
|
||||
Thread.Sleep(1000); // Dirty workaround giving Windows some time to sync
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(SharedInfo.DebugDirectory);
|
||||
|
||||
SteamKit2.DebugLog.AddListener(new Debugging.DebugListener(Path.Combine(SharedInfo.DebugDirectory, "debug.txt")));
|
||||
SteamKit2.DebugLog.AddListener(new Debugging.DebugListener());
|
||||
SteamKit2.DebugLog.Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user