|
|
|
|
using log4net;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Rs.Framework
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 日志帮助类
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class LogHelper
|
|
|
|
|
{
|
|
|
|
|
private static readonly ILog logerror = LogManager.GetLogger("Error");
|
|
|
|
|
private static readonly ILog logdebug = LogManager.GetLogger("Debug");
|
|
|
|
|
private static readonly ILog logingo = LogManager.GetLogger("Info");
|
|
|
|
|
private static readonly ILog logwarning = LogManager.GetLogger("Warning");
|
|
|
|
|
private static readonly ILog logmove = LogManager.GetLogger("Move");
|
|
|
|
|
private static readonly ILog logTestCenter = LogManager.GetLogger("TestCenter");
|
|
|
|
|
|
|
|
|
|
public static void Error(string content) { logerror.Error(content);}
|
|
|
|
|
|
|
|
|
|
public static void Error(string content, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
if (logerror.IsErrorEnabled)
|
|
|
|
|
{
|
|
|
|
|
logerror.Error(content, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Debug(string content) { logdebug.Debug(content);}
|
|
|
|
|
|
|
|
|
|
public static void Debug(string content, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
if (logdebug.IsDebugEnabled)
|
|
|
|
|
{
|
|
|
|
|
logdebug.Debug(content, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Info(string content) { logingo.Info(content);}
|
|
|
|
|
|
|
|
|
|
public static void Info(string content, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
if (logingo.IsInfoEnabled)
|
|
|
|
|
{
|
|
|
|
|
logingo.Info(content, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Warning(string content) { logwarning.Info(content); }
|
|
|
|
|
|
|
|
|
|
public static void Warning(string content, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
if (logwarning.IsInfoEnabled)
|
|
|
|
|
{
|
|
|
|
|
logwarning.Info(content, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void MoveLog(string content)
|
|
|
|
|
{
|
|
|
|
|
if (logmove.IsInfoEnabled)
|
|
|
|
|
{
|
|
|
|
|
logmove.Info(content);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static void MoveLog(string content, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
if (logmove.IsInfoEnabled)
|
|
|
|
|
{
|
|
|
|
|
logmove.Info(content, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void TestCenterLog(string content)
|
|
|
|
|
{
|
|
|
|
|
if (logTestCenter.IsInfoEnabled)
|
|
|
|
|
{
|
|
|
|
|
logTestCenter.Info(content);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static void TestCenterLog(string content, Exception ex)
|
|
|
|
|
{
|
|
|
|
|
if (logTestCenter.IsInfoEnabled)
|
|
|
|
|
{
|
|
|
|
|
logTestCenter.Info(content, ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|