using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; namespace PacsView3D { public class Log4NetHelper { private static Dictionary m_lstLog = new Dictionary(); public static void InitLog4Net(string strLog4NetConfigFile) { log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(strLog4NetConfigFile)); } public static readonly log4net.ILog logInfo = log4net.LogManager.GetLogger("loginfo"); public static readonly log4net.ILog logError = log4net.LogManager.GetLogger("logerror"); public static readonly log4net.ILog logDebug = log4net.LogManager.GetLogger("logdebug"); public static void WriteLog(string info) { if (logInfo.IsInfoEnabled) { logInfo.Info(info); } } public static void WriteLog(string info, Exception ex) { if (logError.IsErrorEnabled) { logError.Error(info, ex); } } public static void WriteLogDebug(string info, Exception ex) { if (logDebug.IsDebugEnabled) { logDebug.Debug(info, ex); } } } }