forked from mlinnen/Netduino-Emulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog4NetLogger.cs
More file actions
41 lines (37 loc) · 1.09 KB
/
Log4NetLogger.cs
File metadata and controls
41 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
namespace Netduino.Core.Services
{
public class Log4netLogger : ILog
{
#region Fields
private readonly log4net.ILog _innerLogger;
#endregion
#region Constructors
public Log4netLogger(Type type)
{
//_innerLogger = log4net.LogManager.GetLogger(type);
log4net.ILog[] loggers = log4net.LogManager.GetCurrentLoggers();
_innerLogger = log4net.LogManager.GetLogger("Logging");
log4net.Config.DOMConfigurator.Configure();
}
#endregion
#region ILog Members
public void Error(Exception exception)
{
_innerLogger.Error(exception.Message, exception);
}
public void Info(string format, params object[] args)
{
_innerLogger.InfoFormat(format, args);
}
public void Warn(string format, params object[] args)
{
_innerLogger.WarnFormat(format, args);
}
#endregion
}
}