This commit is contained in:
2025-02-12 12:10:56 +01:00
parent 705e99b4a7
commit c02a73213b
14 changed files with 1761 additions and 0 deletions

27
Epi2O365/Logger.cs Normal file
View 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);
}
}