Automatic Cronjob Checkin: 20170418-142622

This commit is contained in:
BlubbFish 2017-04-18 12:27:11 +00:00
parent 66843e9b50
commit beabdc513c
2 changed files with 6 additions and 6 deletions

View File

@ -47,7 +47,10 @@ namespace BlubbFish.Utils
public Boolean Delete() public Boolean Delete()
{ {
if(this.file != null) {
this.file.Close(); this.file.Close();
}
File.Delete(this.filename); File.Delete(this.filename);
return !File.Exists(this.filename); return !File.Exists(this.filename);
} }

View File

@ -10,8 +10,7 @@ namespace BlubbFish.Utils
private List<Tuple<DateTime, String, String, LogLevel>> loglist = new List<Tuple<DateTime, String, String, LogLevel>>(); private List<Tuple<DateTime, String, String, LogLevel>> loglist = new List<Tuple<DateTime, String, String, LogLevel>>();
public delegate void LogEvent(String location, String message, LogLevel level, DateTime date); public delegate void LogEvent(String location, String message, LogLevel level, DateTime date);
public enum LogLevel : int public enum LogLevel : Int32 {
{
Debug = 1, Debug = 1,
Notice = 2, Notice = 2,
Info = 4, Info = 4,
@ -70,9 +69,7 @@ namespace BlubbFish.Utils
if (EventError != null && level >= LogLevel.Error) { if (EventError != null && level >= LogLevel.Error) {
EventError(location, message, level, date); EventError(location, message, level, date);
} }
if (EventLog != null) { EventLog?.Invoke(location, message, level, date);
EventLog(location, message, level, date);
}
this.loglist.Add(new Tuple<DateTime, String, String, LogLevel>(date, location, message, level)); this.loglist.Add(new Tuple<DateTime, String, String, LogLevel>(date, location, message, level));
} }
} }