.NET Tracing: What is the “Default” listener?

前端 未结 2 1463
北荒
北荒 2021-01-03 19:55

Every example of tracing in .NET people remove the \"Default\" listener:


  
    
         


        
2条回答
  •  离开以前
    2021-01-03 20:32

    It's not clear from that blog post how the code was run, but the DefaultTraceListener is documented like this:

    By default, the Write and WriteLine methods emit the message to the Win32 OutputDebugString function and to the Debugger.Log method. For information about the OutputDebugString function, see the Platform SDK or MSDN.

    So if Debugger.Log is actually printing to a UI window (and quite possibly scrolling it etc) I can see that causing a lot of the slowdown.

提交回复
热议问题