[英]Logging how much
Here is our scenario. 这是我们的场景。 A wpf app works fine in dev environment. WPF应用程序在开发环境中运行良好。 When published to other environments such as staging, UAT & prodn environments we run into issues. 当发布到其他环境(例如暂存,UAT和产品环境)时,我们会遇到问题。
To figure out the issues is it a good idea to have a line which calls a log message after every line of code with Debug directives. 要找出问题所在,最好在每行带有Debug指令的代码行之后都有一条调用日志消息的行。
If so how to handle it in release mode. 如果是这样,如何在发布模式下处理它。 Our concern is every call to log ends up reading and writing to a file will this affect the performance. 我们关心的是每次对日志的调用最终都会读写文件,这会影响性能。
If so any suggestions. 如果是这样的话。 Thanks N 谢谢N
You could use log tags (instead of log levels) to break these calls down into manageable chunks, then turn logging ON or OFF for the tags in the production environment. 您可以使用日志标签(而不是日志级别)将这些调用分解为可管理的块,然后在生产环境中打开或关闭标签的日志记录。 My tagalog library can help: https://github.com/dorkitude/tagalog 我的他加禄语图书馆可以提供帮助: https : //github.com/dorkitude/tagalog
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.