From 4a156fff4c9ea578ee4c10794e7c3e56d7200ad8 Mon Sep 17 00:00:00 2001 From: mausch Date: Sun, 12 May 2013 23:31:12 -0300 Subject: [PATCH] Breaking change: new "Add" method in logger --- QuartzNetWebConsole/AbstractLogger.cs | 2 ++ QuartzNetWebConsole/ILogger.cs | 4 +++- QuartzNetWebConsole/MemoryLogger.cs | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/QuartzNetWebConsole/AbstractLogger.cs b/QuartzNetWebConsole/AbstractLogger.cs index 9fbd762..8246901 100644 --- a/QuartzNetWebConsole/AbstractLogger.cs +++ b/QuartzNetWebConsole/AbstractLogger.cs @@ -53,6 +53,8 @@ IEnumerator IEnumerable.GetEnumerator() { public abstract Expression Expression { get; } public abstract Type ElementType { get; } public abstract IQueryProvider Provider { get; } + public abstract void Add(string msg); + public virtual void JobScheduled(ITrigger trigger) { } diff --git a/QuartzNetWebConsole/ILogger.cs b/QuartzNetWebConsole/ILogger.cs index 529e2e1..59d33ce 100644 --- a/QuartzNetWebConsole/ILogger.cs +++ b/QuartzNetWebConsole/ILogger.cs @@ -4,5 +4,7 @@ using QuartzNetWebConsole.Views; namespace QuartzNetWebConsole { - public interface ILogger: ISchedulerListener, IJobListener, ITriggerListener, IQueryable {} + public interface ILogger: ISchedulerListener, IJobListener, ITriggerListener, IQueryable { + void Add(string msg); + } } \ No newline at end of file diff --git a/QuartzNetWebConsole/MemoryLogger.cs b/QuartzNetWebConsole/MemoryLogger.cs index 0658cf8..7a5bf8a 100644 --- a/QuartzNetWebConsole/MemoryLogger.cs +++ b/QuartzNetWebConsole/MemoryLogger.cs @@ -23,6 +23,10 @@ public MemoryLogger(int capacity) { entries = new LimitedList(capacity); } + public override void Add(string msg) { + entries.Add(new LogEntry(msg)); + } + public override void JobScheduled(ITrigger trigger) { var desc = string.Format("Job {0} scheduled with trigger {1}", DescribeJob(trigger.JobKey.Group, trigger.JobKey.Name), Describe(trigger)); entries.Add(new LogEntry(desc));