mirror of
https://github.com/EnderIce2/SDR-RPC.git
synced 2025-05-25 19:54:26 +00:00
22 lines
768 B
C#
22 lines
768 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace EnderIce2.SDRSharpPlugin
|
|
{
|
|
public static class LogWriter
|
|
{
|
|
public static void WriteToFile(string Message)
|
|
{
|
|
if (SDRSharp.Radio.Utils.GetBooleanSetting("LogRPC", false))
|
|
{
|
|
string path = AppDomain.CurrentDomain.BaseDirectory + "\\RPCLogs\\";
|
|
if (!Directory.Exists(path))
|
|
{
|
|
Directory.CreateDirectory(path);
|
|
}
|
|
using StreamWriter sw = File.AppendText(AppDomain.CurrentDomain.BaseDirectory + "\\RPCLogs\\DiscordRPCLog_" + DateTime.Now.Date.ToShortDateString().Replace('/', '_') + ".log");
|
|
sw.WriteLine($"[{DateTime.Now}] {Message}");
|
|
}
|
|
}
|
|
}
|
|
} |