Reload configuration & bugfixes

This commit is contained in:
2016-03-23 17:52:00 +01:00
parent 830cd86551
commit 5b11bc2a62
18 changed files with 326 additions and 164 deletions
+29
View File
@@ -30,9 +30,36 @@ namespace Ntp.Analyzer.Log
{
public static class LogFactory
{
private static List<LogBase> logs = new List<LogBase>();
public static void RefreshLogs()
{
foreach (LogBase log in logs)
log.Refresh ();
}
public static void Cleanup()
{
foreach (LogBase log in logs)
log.Close ();
logs.Clear ();
}
public static ActivityLog CreateActivityLog()
{
return new ActivityLog ();
}
public static LogGroup CreateGroupLog()
{
return new LogGroup ();
}
public static LogBase CreateLog(LogConfiguration config)
{
TextLog log = new TextLog(config.File, config.Treshold);
logs.Add (log);
return log;
}
@@ -46,6 +73,8 @@ namespace Ntp.Analyzer.Log
group.Add(log);
}
logs.Add (group);
return group;
}
}