Added a "log level" and a "close to tray" settings for the Windows application

This commit is contained in:
David Pierron
2021-02-05 15:01:21 +01:00
parent da2f4345ac
commit a7a45e6fa2
10 changed files with 250 additions and 79 deletions

View File

@@ -3,9 +3,47 @@ using System.IO;
class LogController
{
// TBD - done via https://stackoverflow.com/questions/20185015/how-to-write-log-file-in-c
public static void WriteLog(string strLog)
private static LogController _instance = new LogController();
public static LogController instance
{
get
{
return _instance;
}
}
public int level
{
get;
set;
}
public void LogError(string strLog)
{
this.WriteLog(0, strLog);
}
public void LogWarning(string strLog)
{
this.WriteLog(1, strLog);
}
public void LogInfo(string strLog)
{
this.WriteLog(2, strLog);
}
public void LogDebug(string strLog)
{
this.WriteLog(3, strLog);
}
// TBD - done via https://stackoverflow.com/questions/20185015/how-to-write-log-file-in-c
public void WriteLog(int logLevel, string strLog)
{
if (logLevel > this.level) return;
StreamWriter LogStreamWriter;
FileStream LogFileStream = null;
DirectoryInfo LogDirectoryInfo = null;