初始化
This commit is contained in:
46
Face.Log4Net/Log4NetHelper.cs
Normal file
46
Face.Log4Net/Log4NetHelper.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Face.Log4Net
|
||||
{
|
||||
public class Log4NetHelper
|
||||
{
|
||||
public static void Log(string logMessage)
|
||||
{
|
||||
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
|
||||
if (log.IsInfoEnabled)
|
||||
{
|
||||
log.Info(logMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Debug(string logMessage)
|
||||
{
|
||||
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
|
||||
if (log.IsInfoEnabled)
|
||||
{
|
||||
log.Info(logMessage);
|
||||
}
|
||||
}
|
||||
public static void Debug(string logMessage, Exception ex)
|
||||
{
|
||||
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
|
||||
if (log.IsInfoEnabled)
|
||||
{
|
||||
log.Error(logMessage, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Log(string logMessage, Exception ex)
|
||||
{
|
||||
var log = LoggerFactory.CreateInstance(Log4NetType.Info.ToString());
|
||||
if (log.IsInfoEnabled)
|
||||
{
|
||||
log.Error(logMessage, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user