Exemple #1
0
        internal ExcelQueryExecutor(ExcelQueryArgs args, ILogManagerFactory logManagerFactory)
        {
            ValidateArgs(args);
            _args = args;

            if (logManagerFactory != null)
            {
                _logManagerFactory = logManagerFactory;
                _log = _logManagerFactory.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            }

            if (_log != null && _log.IsDebugEnabled == true)
            {
                _log.DebugFormat("Connection String: {0}", ExcelUtilities.GetConnection(args).ConnectionString);
            }

            GetWorksheetName();
        }
        public byte[] GetBytes(string key)
        {
            byte[] result;
            #region 缓存操作前
            #endregion

            #region 缓存操作
            result = GetBytesCore(key);
            #endregion

            #region 缓存操作后
            if (result == null)
            {
                Logger.DebugFormat("GetBytes 缓存查询未命中 Key=【{0}】", key);
            }
            #endregion
            return(result);
        }
Exemple #3
0
 /// <summary>
 /// 记录监视结果
 /// </summary>
 /// <param name="method">监视的方法名</param>
 /// <param name="desc">操作描述信息</param>
 /// <param name="data">相关信息数据,实体信息或者sql等</param>
 /// <param name="watch">Stopwatch实例</param>
 /// <param name="reset">记录监视信息后,是否重置当前Stopwatch</param>
 protected virtual void Monitoring(string method, string desc, string data, Stopwatch watch, bool reset = true)
 {
     if (watch == null)
     {
         Logger.WarnFormat("检测到监控计时器为空,所在方法为【{0}】", method);
         return;
     }
     watch.Stop();
     MonitorLogger.DebugFormat("【{0}】 【{1}】 表名为【{2}】 耗时【{3}】毫秒 相关信息【{4}】", method, desc, tableInfo.TableName, watch.ElapsedMilliseconds, data);
     if (reset)
     {
         watch.Reset();
     }
     watch.Start();
 }