Added Support for Debug Logging
Updated a couple of variables for better memory use. Added Support for ignoring specific streamers Moved to using a SingletonFactory for Singlton Classes No Longer Using MessageBox for disconnected message Added better detection for disconnected to stop it poping with other problems Added Window and menu option to open window to manage ignored streamers
This commit is contained in:
38
TwitchDesktopNotifications/Core/Logger.cs
Normal file
38
TwitchDesktopNotifications/Core/Logger.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TwitchDesktopNotifications.Core
|
||||
{
|
||||
public class Logger : SingletonFactory<Logger>, Singleton
|
||||
{
|
||||
private string _name;
|
||||
private StreamWriter sw;
|
||||
public Logger()
|
||||
{
|
||||
_name = DateTime.Now.ToString("dd_mm_yyyy HH_mm")+".log";
|
||||
}
|
||||
|
||||
~Logger()
|
||||
{
|
||||
if (sw != null)
|
||||
{
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public StreamWriter Writer {
|
||||
get {
|
||||
if(sw == null)
|
||||
{
|
||||
sw = new StreamWriter(_name);
|
||||
}
|
||||
return sw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user