stage
This commit is contained in:
27
Epi2O365/Logger.cs
Normal file
27
Epi2O365/Logger.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using log4net.Config;
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epi2Exchange2
|
||||
{
|
||||
public static class Logger
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
static Logger()
|
||||
{
|
||||
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
|
||||
XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
|
||||
}
|
||||
|
||||
public static void Info(string message) => log.Info(message);
|
||||
public static void Warn(string message) => log.Warn(message);
|
||||
public static void Error(string message, Exception ex = null) => log.Error(message, ex);
|
||||
public static void Debug(string message) => log.Debug(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user