Esempio n. 1
0
 public static Log4Singleton getInstance()
 {
     if (instance == null)
     {
         instance = new Log4Singleton();
     }
     return(instance);
 }
Esempio n. 2
0
        /// <summary>
        /// 写日志
        /// </summary>
        /// <param name="logLevel">日志等级</param>
        /// <param name="message">日志信息</param>
        /// <param name="type">类名 方法名</param>
        private static void WriteLog(LogLevel logLevel, string message)
        {
            ILog Log = Log4Singleton.getInstance().Init(logLevel.ToString());

            switch (logLevel)
            {
            case LogLevel.Debug:
                Log.Debug(message);
                break;

            case LogLevel.Error:
                Log.Error(message);
                break;

            case LogLevel.Info:
                Log.Info(message);
                break;

            case LogLevel.Warning:
                Log.Warn(message);
                break;
            }
        }