You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
840 B
C#
38 lines
840 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace ZJ_BYD.Untils
|
|
{
|
|
public class LogHelper
|
|
{
|
|
private LogHelper()
|
|
{
|
|
|
|
}
|
|
|
|
public static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
|
|
|
|
public static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
|
|
|
|
public static void SetConfig()
|
|
{
|
|
log4net.Config.XmlConfigurator.Configure();
|
|
}
|
|
|
|
public static void SetConfig(FileInfo configFile)
|
|
{
|
|
log4net.Config.XmlConfigurator.Configure(configFile);
|
|
}
|
|
|
|
public static void WriteLog(string info)
|
|
{
|
|
loginfo.Info(info);
|
|
}
|
|
|
|
public static void WriteErrorLog(string info, Exception se=null)
|
|
{
|
|
logerror.Error(info, se);
|
|
}
|
|
}
|
|
}
|