|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace KingUnit.Framework
{
public class LogProvider
{
private static log4net.ILog log = null;
private LogProvider()
{
}
private static log4net.ILog GetLogger()
{
if (log == null)
{
log = log4net.LogManager.GetLogger(ConfigProvider.Log4NetAppender);
}
return log;
}
public static void LogInfo(string message)
{
var log = GetLogger();
log.Info(message);
}
public static void LogDebug(string message, Exception exception = null)
{
var log = GetLogger();
log.Debug(message, exception);
}
public static void LogWarn(string message, Exception exception = null)
{
var log = GetLogger();
log.Warn(message, exception);
}
public static void LogFatal(string message, Exception exception = null)
{
var log = GetLogger();
log.Fatal(message, exception);
}
public static void LogError(string message, Exception exception = null)
{
var log = GetLogger();
log.Error(message, exception);
}
}
}
|