You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
848 B
C#
35 lines
848 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace NetMFAPatcher.Utils
|
|
{
|
|
public static class Logger
|
|
{
|
|
static StreamWriter _writer;
|
|
public static void Log(string text, bool logToScreen = true,ConsoleColor color = ConsoleColor.White)
|
|
{
|
|
if (_writer == null)
|
|
{
|
|
File.Delete("Dump.log");
|
|
_writer = new StreamWriter("Dump.log", true);
|
|
_writer.AutoFlush = true;
|
|
|
|
}
|
|
_writer.WriteLine(text);
|
|
|
|
if (logToScreen)
|
|
{
|
|
Console.ForegroundColor = color;
|
|
Console.WriteLine(text);
|
|
Console.ForegroundColor = ConsoleColor.White;
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|