/ d:TRACE有多重? [英] How heavy is /d:TRACE?

查看:52
本文介绍了/ d:TRACE有多重?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在主题中...


使用/ d:TRACE开关连接的开销是多少?

Trace类是一个方便且可配置的记录器,但它需要使用/ d:TRACE开关构建

可执行文件。

在大小和性能方面使用的交换机很重

可执行文件?如果我想在发布版本中使用
,那么编写我自己的记录器类会更好吗?


DoB

As in the subject...

What is an overhead cost conneted with using the /d:TRACE switch?
The Trace class is a convenient and configurable logger, but it requires the
executable to be built with the /d:TRACE switch.
Is using of the switch heavy in terms of size and performance of the
executable? Is it better to write my own logger class if I want it to be
used in the release build?

DoB

推荐答案

DoB< Do*@dob.comwrote:
DoB <Do*@dob.comwrote:

在主题中......


使用/ d:TRACE开关连接的开销是多少?

Trace类是一个方便且可配置的记录器,但它需要

可执行文件用/ d:TRACE开关构建。



可执行文件的大小和性能方面是否使用了交换机?如果我希望它在发布版本中使用
,那么编写我自己的logger类会更好吗?
As in the subject...

What is an overhead cost conneted with using the /d:TRACE switch?
The Trace class is a convenient and configurable logger, but it requires the
executable to be built with the /d:TRACE switch.
Is using of the switch heavy in terms of size and performance of the
executable? Is it better to write my own logger class if I want it to be
used in the release build?



其沉重完全取决于您在代码中调用Trace的次数




就个人而言,我更喜欢log4net的灵活性(这当然是

比编写自己的日志框架更好)但是选择是

你的...


-

Jon Skeet - < sk *** @ pobox.com>
http ://www.pobox.com/~skeet 博客: http:/ /www.msmvps.com/jon.skeet

英国的世界级.NET培训: http://iterativetraining.co.uk

Its "heaviness" entirely depends on how many calls to Trace you make
within your code.

Personally I prefer the flexibility of log4net (and that''s certainly
better than writing your own logging framework) but the choice is
yours...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk


其沉重完全取决于您在代码中使用跟踪调用
Its "heaviness" entirely depends on how many calls to Trace you make

的次数。
within your code.



你的意思是有效的电话,还是

代码里面的所有跟踪声明?


通过有效调用我的意思是跟踪例程由

执行路径调用并实际执行某些操作,例如写入文件。

当执行路径未到达或进行

调用时,调用无效,但未定义跟踪侦听器。

Do you mean effective calls, or just the all the trace statements inside the
code?

By an effective call I mean the tracing routine being called by the
execution path and actually doing something, e.g. writing to a file.
The call is ineffective when the execution path does not reach it or the
call is made, but no trace listener is defined.


就个人而言,我更喜欢log4net的灵活性(而且肯定比编写自己的日志框架更好),但是选择是

你的...
Personally I prefer the flexibility of log4net (and that''s certainly
better than writing your own logging framework) but the choice is
yours...



我会看看这个,谢谢。


DoB

I will take a look at this, thanks.

DoB


12月18日下午1:35,DoB < D ... @ dob.comwrote:
On Dec 18, 1:35 pm, "DoB" <D...@dob.comwrote:

其沉重完全取决于您在代码中对Trace进行多少次调用


Its "heaviness" entirely depends on how many calls to Trace you make
within your code.



你的意思是有效的电话,还是

代码里面的所有跟踪声明?


通过有效调用我的意思是跟踪例程由

执行路径调用并实际执行某些操作,例如写入文件。

当执行路径未到达或进行

调用时调用无效,但未定义跟踪侦听器。


Do you mean effective calls, or just the all the trace statements inside the
code?

By an effective call I mean the tracing routine being called by the
execution path and actually doing something, e.g. writing to a file.
The call is ineffective when the execution path does not reach it or the
call is made, but no trace listener is defined.



好​​吧,当没有跟踪监听器定义为
时,仍会有一个*小*命中,但显然是一个较大的有微量听众。

沉重将取决于所有这些事情。


Jon

Well, there''ll still be a *small* hit when no trace listener is
defined, but obviously a larger one when there are trace listeners.
The "heaviness" will depend on all of these things.

Jon


这篇关于/ d:TRACE有多重?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆