static Logger() { LoggerImplementDict.Add("Console", typeof(ConsoleLogImpl)); LoggerImplementDict.Add("File", typeof(FileLogImpl)); LogSetting.Default.Level = LogLevel.Core; if (LogSetting.Default.Target == null) { LogSetting.Default.Target = new List <string>(); LogSetting.Default.Target.Add("File"); } if (LogSetting.Default.Level == null) { LogSetting.Default.Level = LogLevel.Error; } foreach (string targetItem in LogSetting.Default.Target) { ILogImpl logImpl = ReflectionUtil.CreateInstance(LoggerImplementDict[targetItem]) as ILogImpl; if (logImpl != null) { Init(logImpl); } } }
public void Release() { if (null != m_logImpl) { m_logImpl.Release(); m_logImpl = null; } }
public static bool Init(ILogImpl logImpl, object param) { if (null != s_log) { return(false); } s_log = new Log(); return(s_log.Init(logImpl, param)); }
public bool Init(ILogImpl logImpl, object param) { m_logImpl = logImpl; m_param = param; return m_logImpl.Init(param); }
public static void Init(ILogImpl logImp) { LogEvent = (LogEventHandler)Delegate.Combine(LogEvent, new LogEventHandler(logImp.ProcessLog)); }