Debug类和Trace类之间有什么区别? [英] What’s the difference between the Debug class and Trace class?
问题描述
Debug Class提供了一组方法和属性这有助于调试您的代码。如果您使用Debug类中的方法打印调试信息并使用断言检查逻辑,则可以使代码更加健壮,而不影响运输产品的性能和代码大小。
您可以使用Trace类中的属性和方法来发布版本。仪器允许您监视在现实生活中运行的应用程序的运行状况。跟踪可帮助您隔离问题并修复它们,而不会影响正在运行的系统。$
调试仅执行生产时间,并且只在发布产品时执行跟踪
测试和优化。 b $ b我们也可以说Debug是在应用程序开发时使用的,
当应用程序部署时使用Trace选项,当跟踪任何错误并将其写入日志文件时
I am attempting to write better error-handling and debug logic in one of our applications. Can someone explain the difference between the Debug and Trace class? The documentation looks pretty similar. I want to use these classes in conjunction with NLog to improve our debugging efforts.
Debug Class provides a set of methods and properties that help debug your code. If you use methods in the Debug class to print debugging information and check your logic with assertions, you can make your code more robust without impacting the performance and code size of your shipping product.
You can use the properties and methods in the Trace class to instrument release builds. Instrumentation allows you to monitor the health of your application running in real-life settings. Tracing helps you isolate problems and fix them without disturbing a running system.
debugging perform only production time and tracing is perform when you release your product
testing and optimization only.
we can also say that Debug is used at the time of application development,
While Trace option is used at the application deployment when any errors will be traced and will be written to log files
这篇关于Debug类和Trace类之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!