33 lines
750 B
C#
33 lines
750 B
C#
using log4net;
|
|
using System;
|
|
|
|
namespace JY.Inspection
|
|
{
|
|
internal class Log4Helper
|
|
{
|
|
public static void WriteLog(Type t, Exception ex)
|
|
{
|
|
ILog log = LogManager.GetLogger(t);
|
|
log.Error(ex);
|
|
}
|
|
|
|
public static void WriteLog(Type t, string msg)
|
|
{
|
|
ILog log = LogManager.GetLogger(t);
|
|
log.Info(msg);
|
|
}
|
|
|
|
public static void WriteLog(string className, Exception ex)
|
|
{
|
|
ILog log = LogManager.GetLogger(className);
|
|
log.Error(ex);
|
|
}
|
|
|
|
public static void WriteLog(string className, string msg)
|
|
{
|
|
ILog log = LogManager.GetLogger(className);
|
|
log.Info(msg);
|
|
}
|
|
}
|
|
}
|