VisualStudio代码调试输出跟踪
class EFIntercepterLogging : DbCommandInterceptor
{
private readonly Stopwatch _stopwatch = new Stopwatch();
public override void ScalarExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext<object> interceptionContext)
{
base.ScalarExecuting(command, interceptionContext);
_stopwatch.Restart();
}
public override void ScalarExecuted(System.Data.Common.DbCommand command, DbCommandInterceptionContext<object> interceptionContext)
{
_stopwatch.Stop();
if (interceptionContext.Exception != null)
{
Trace.TraceError ("Exception:{1} \r\n --> Error executing command: {0}", command.CommandText, interceptionContext.Exception.ToString());
}
else
{
Trace.TraceInformation("\r\n执行时间:{0} 毫秒\r\n-->ScalarExecuted.Command:{1}\r\n", _stopwatch.ElapsedMilliseconds, command.CommandText);
}
base.ScalarExecuted(command, interceptionContext);
}
}
VisualStudio代码调试输出跟踪的更多相关文章
- 目标跟踪学习系列十:Struck:Structured Output Tracking with Kernels 代码调试
本来想看完代码再具体的写的.可是有人问了就先贴出来吧! 代码调试中会遇到的一些的问题. 首先,你没有代码的话能够在这里下载:http://download.csdn.net/detail/u01219 ...
- GDB代码调试与使用
GDB代码调试与使用 Linux下GDB调试代码 源代码 编译生成执行文件 gcc -g test.c -o test 使用GDB调试 启动GDB:gdb test 从第一行列出源代码:list 直接 ...
- Node.js系列文章:如何进行代码调试
使用任何一门编程语言,都少不了代码调试这一功能.我们在使用JavaScript编写浏览器端代码时,Chrome提供了强大的调试工具Dev Tools,但是在编写Node.js代码时,大多数人最开始都使 ...
- VisualStudio 断点调试详解
本文详细告诉大家 VisualStudio 断点调试的功能和使用方法,本文使用的是最新 VisualStudio2019 的功能,也许在你看到这篇博客的时候这个版本已经过时 本文将会按照从简单到复杂, ...
- android调试输出
测试时不想直接debug总要调试输出一些字符串信息,那以下方法可选: 1.用Log.i(TAG, "onCreate");日志输出. 先要引用 import android.uti ...
- System.out.println调试输出
Android开发中在代码中通过System.out.println调试输出在Logcat窗口中可以看到. 但Logcat视图中夹杂了太多的其它App及底层的信息,看起来并不明朗.可以在Logcat视 ...
- 初识 Javascript.02 -- Date日期、Math对象、数据类型转换、字符串、布尔Boolean、逻辑运算符、if else 、三元表达式、代码调试方法、
Date()对象: Date对象用于处理日期和时间. 1.1 Math对象 ◆Math.ceil() 天花板函数 向上取整 只取整数,不足则进1 ◆Math.floor() 地板函数 ...
- #7 Python代码调试
前言 Python已经学了这么久了,你现在已经长大了,该学会自己调试代码了!相信大家在编写程序过程中会遇到大量的错误信息,我也不例外的啦-遇到这些问题该怎么解决呢?使用最多的方法就是使用print打印 ...
- 【转】分享两个基于MDK IDE的调试输出技巧
我们在STM32开发调试过程中,常常需要做些直观的输出,如果手头没有相关的设备或仪器,我们可以使用 IDE自带的工具.这里分享两个基于MDK IDE的调试输出技巧. 一.使用其自带的逻辑分析仪查看波 ...
随机推荐
- OpenSSL命令---pkcs7
用途: 用于处理DER或者PEM格式的pkcs#7文件. 用法: openssl pkcs7 [-inform PEM|DER] [-outform PEM|DER] [-in filename] [ ...
- Python的Descriptor和Property混用
一句话,把Property和Descriptor作用在同一个名字上,就只有Property好使.
- Solve: Your project references the latest version of Entity Framework (for MySQL) in Visual Studio 2013
The error message while trying to create a ADO.net Entity Data Model ( Entity Framework 6 ) for MySq ...
- Silverlight:版本控制的衍化
版本控制是企业开发中一个老生长谈的主题,这也是大部分公司新人进来后需要接纳的一个基础知识体系. 从08年首次接触商业软件编写后,这几年先后接触了SVN,TFS,Git这几个主要的版本控制器,但是并没有 ...
- Request is not available in this context
部署到新服务器的IIS的时候发现这个错误: Request is not available in this context 解决方案: <system.web> <customEr ...
- WinStore控件之Button、HyperlinkButton、RadioButton、CheckBox、progressBar、ScrollViewer、Slider
1.Button protected override void OnNavigatedTo(NavigationEventArgs e) { /* * Button - 按钮控件,其全部功能是通过其 ...
- LocalBroadcastManager 使用小解
最近在开发平板项目,完全是fragmentactivity+fragment的结构.看起来似乎简单,但是和以前不同的是,业务逻辑非常复杂,多处的非常规跳转,fragment之间的数据交换,一处更新多处 ...
- listview 设置数组为空
listview.setEmpty(View view); 使用listView或者gridView时,当列表为空时,有时需要显示一个特殊的empty view来提示用户,今日对这个方法进行一下小结, ...
- iOS开源项目教程大合集
UI篇 1.MMDrawerController http://www.cnblogs.com/shangdahao/p/3142204.html 2.SVPullToRefresh http://w ...
- java之源码路径及api
jav源码地址:D:\Program Files\jdk1.7\src.zip class类地址:D:\Program Files\jdk1.7\jre\lib\rt.jar 在线api底地址:htt ...