Change log system
This commit is contained in:
30
Samples/MachineJob/ConsoleLogProvider.cs
Normal file
30
Samples/MachineJob/ConsoleLogProvider.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Quartz.Logging;
|
||||
|
||||
namespace MachineJob
|
||||
{
|
||||
// simple log provider to get something to the console
|
||||
public class ConsoleLogProvider : ILogProvider
|
||||
{
|
||||
public Logger GetLogger(string name)
|
||||
{
|
||||
return (level, func, exception, parameters) =>
|
||||
{
|
||||
if (level >= Quartz.Logging.LogLevel.Info && func != null)
|
||||
{
|
||||
Console.WriteLine("[" + DateTime.Now.ToLongTimeString() + "] [" + level + "] " + func(), parameters);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
public IDisposable OpenNestedContext(string message)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IDisposable OpenMappedContext(string key, object value, bool destructure = false)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user