Is passive logging possible in .NET?

前端 未结 6 436
北海茫月
北海茫月 2021-02-02 03:19

I\'m frequently frustrated by the amount of logging I have to include in my code and it leads me to wonder if there\'s a better way of doing things.

I don\'t know if thi

6条回答
  •  难免孤独
    2021-02-02 03:28

    In addition to the logging methods mentioned by Jon, its probably also worth noting another useful feature in VS for tracing program flow, and that is the ability to have non-breaking breakpoints that will simply output a message or run a macro when hit (note you can print variable values as well)

    Right click on your breakpoint and choose the When Hit... context menu item.

    And of course one other very useful feature is the Trace object and Trace Listners in System.Diagnostics.

提交回复
热议问题