Esempio n. 1
0
 protected void Log_Click(object sender, EventArgs e)
 {
     var extra = new ExtraInfo
     {
         CheckBoxListFilterItem1 = MFilter1.Text,
         CheckBoxListFilterItem2 = MFilter2.Text,
         DropDownListFilterItem1 = SFilter1.Text,
         DropDownListFilterItem2 = SFilter2.Text,
         TextBoxFilterItem1 = TFilter1.Text,
         TextBoxFilterItem2 = TFilter2.Text,
     };
     Stopwatch sw = Stopwatch.StartNew();
     for (int i = 0; i < int.Parse(Count.Text); i++)
     {
         AppInfoCenterService.LoggingService.Debug(ModuleName.Text, Category.Text, SubCategory.Text, "Debug" + LogMessage.Text, extra);
         AppInfoCenterService.LoggingService.Info(ModuleName.Text, Category.Text, SubCategory.Text, "Info" + LogMessage.Text, extra);
         AppInfoCenterService.LoggingService.Warning(ModuleName.Text, Category.Text, SubCategory.Text, "Warning" + LogMessage.Text, extra);
         AppInfoCenterService.LoggingService.Error(ModuleName.Text, Category.Text, SubCategory.Text, "Error" + LogMessage.Text, extra);
     }
     Result.Text = sw.ElapsedMilliseconds.ToString();
 }
Esempio n. 2
0
 protected void HandleException_Click(object sender, EventArgs e)
 {
     var extra = new ExtraInfo
     {
         CheckBoxListFilterItem1 = MFilter1.Text,
         CheckBoxListFilterItem2 = MFilter2.Text,
         DropDownListFilterItem1 = SFilter1.Text,
         DropDownListFilterItem2 = SFilter2.Text,
         TextBoxFilterItem1 = TFilter1.Text,
         TextBoxFilterItem2 = TFilter2.Text,
     };
     Stopwatch sw = Stopwatch.StartNew();
     for (int i = 0; i < int.Parse(Count.Text); i++)
     {
         if (string.IsNullOrEmpty(InnerExceptionMessage.Text))
             new Exception(ExceptionMessage.Text).Handle(ModuleName.Text, Category.Text, SubCategory.Text, ExceptionDescription.Text, extra);
         else
             new Exception(ExceptionMessage.Text, new NullReferenceException(InnerExceptionMessage.Text)).Handle(ModuleName.Text, Category.Text, SubCategory.Text, ExceptionDescription.Text, extra);
     }
     Result.Text = sw.ElapsedMilliseconds.ToString();
 }
Esempio n. 3
0
 public static void Handle(this Exception exception, string moduleName, string categoryName, string subcategoryName, string description, ExtraInfo extraInfo)
 {
     AppInfoCenterService.ExceptionService.Handle(moduleName, categoryName, subcategoryName, exception, description, extraInfo);
 }
Esempio n. 4
0
 public static void Handle(this Exception exception, string description, ExtraInfo extraInfo)
 {
     AppInfoCenterService.ExceptionService.Handle(exception, description, extraInfo);
 }
Esempio n. 5
0
        public ActionResult Index()
        {
            Stopwatch sw = Stopwatch.StartNew();

            var extraInfo = new ExtraInfo
            {
                DisplayItems = new Dictionary<string, string>()
                {
                    { "DisplayItem1", "DisplayItem1" },
                    { "DisplayItem2", "DisplayItem2" }
                },
                DropDownListFilterItem1 = stringfilterpool[rnd.Next(4)],
                DropDownListFilterItem2 = stringfilterpool[rnd.Next(4)],
                CheckBoxListFilterItem1 = stringfilterpool[rnd.Next(4)],
                CheckBoxListFilterItem2 = stringfilterpool[rnd.Next(4)],
            };

            AppInfoCenterService.LoggingService.Error("测试日志", extraInfo);

            new Exception("错误" + Guid.NewGuid().ToString(), new Exception("内部错误")).Handle(extraInfo: extraInfo);

            AppInfoCenterService.PerformanceService.StartPerformanceMeasure("性能测试1");
            aa();
            AppInfoCenterService.PerformanceService.SetPerformanceMeasurePoint("性能测试1", "性能测试1aa");
            cc();
            AppInfoCenterService.PerformanceService.SetPerformanceMeasurePoint("性能测试1", "性能测试1cc");
            dd();
            AppInfoCenterService.PerformanceService.SetPerformanceMeasurePoint("性能测试1", "性能测试1dd");

            //try
            //{
            //    ViewBag.Message = WcfService.WcfServiceLocator.GetService<IFuckService>().YouWannaFuckWho("you", 200);
            //}
            //catch (Exception ex)
            //{
            //    ex.Handle();
            //    ViewBag.Message = ex.Message;
            //}

            //ViewBag.Time = sw.ElapsedMilliseconds;

            //throw new Exception("assadad");
            //ViewBag.Message = suckservice.Suck();
            return View();
        }
Esempio n. 6
0
 public static void Handle(this Exception exception, string moduleName, string categoryName, string subcategoryName, string description, ExtraInfo extraInfo)
 {
     AppInfoCenterService.ExceptionService.Handle(moduleName, categoryName, subcategoryName, exception, description, extraInfo);
 }
Esempio n. 7
0
 public static void Handle(this Exception exception, string description, ExtraInfo extraInfo)
 {
     AppInfoCenterService.ExceptionService.Handle(exception, description, extraInfo);
 }