Skip to content

Commit

Permalink
Breaking change: new "Add" method in logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mausch committed May 13, 2013
1 parent 493e806 commit 4a156ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions QuartzNetWebConsole/AbstractLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

}
Expand Down
4 changes: 3 additions & 1 deletion QuartzNetWebConsole/ILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
using QuartzNetWebConsole.Views;

namespace QuartzNetWebConsole {
public interface ILogger: ISchedulerListener, IJobListener, ITriggerListener, IQueryable<LogEntry> {}
public interface ILogger: ISchedulerListener, IJobListener, ITriggerListener, IQueryable<LogEntry> {
void Add(string msg);
}
}
4 changes: 4 additions & 0 deletions QuartzNetWebConsole/MemoryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public MemoryLogger(int capacity) {
entries = new LimitedList<LogEntry>(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));
Expand Down

0 comments on commit 4a156ff

Please sign in to comment.