简单记录日志 

internal static class LogWriter
    {
        private static LogHelper Getlog()
        {
            string LogerSource = "LogText";
            LogHelper log = new LogHelper(LogerSource);
            return log;
        }
        /// <summary>
        /// 记录日志
        /// </summary>
        /// <param name="message"></param>
        public static void LogInfo(string message)
        {
            try
            {
                if (string.IsNullOrEmpty(message))
                {
                    return;
                }
                LogHelper log = Getlog();
                log.LogInfo(message);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 记录错误
        /// </summary>
        /// <param name="message"></param>
        public static void LogError(string message)
        {
            try
            {
                if (string.IsNullOrEmpty(message))
                {
                    return;
                }
                LogHelper log = Getlog();
                log.LogError(message);
            }
            catch
            {
            }
        }
    }
LogWriter

相关文章: