Files
rookie/Utilities/Logger.cs
Harry Fn Potter 9f783b3b1a 2.4.2
2021-07-20 02:17:18 -04:00

27 lines
750 B
C#

using System;
using System.IO;
using System.Windows.Forms;
namespace AndroidSideloader
{
class Logger
{
public string logfile = Properties.Settings.Default.CurrentLogPath;
public static bool Log(string text, bool ret = true)
{
string time = DateTime.Now.ToString("hh:mmtt(UTC): ");
if (text.Length > 5)
{
string newline = "\n";
if (text.Length > 40 && text.Contains("\n"))
newline += "\n\n";
try {File.AppendAllText(Properties.Settings.Default.CurrentLogPath, time + text + newline); } catch { }
return ret;
}
return ret;
}
}
}