Visual Studio Add to Add Trace

I was looking to write / get a visual addition to the studio.

I want to be able to write descriptive log calls at the top and bottom of a function.

like this

log.debug("TheClass.TheMethod(string TheStringParam ="+TheStringParam+") - in");

log.debug("TheClass.TheMethod(string TheStringParam ="+TheStringParam+") - out");

      

Is there an adin that does this? Is there a source somewhere to add to the Ghost Doc that does reflection (or whatever) parse parameters, etc.

+2


source to share


3 answers


http://www.codeproject.com/KB/trace/LoggingDemo.aspx



+1


source


It sounds like you might want to look into AOP for this. Here's a CodeProject Example . Here 's a blog post . Should be enough to get you started.



+2


source


CodeRush comes with a ( Insert Selection ) feature that allows you to select a block of code / text, press a key, and have a block enclosed in your code / text selection.

This text can be calculated at the time of insertion based on the surrounding context, if needed. Many of them have built StringProviders (tokens) that are available out of the box, while others can be created quite easily based on your needs.

For example. StringProvider "? MethodName" is being created, but some work (not much) needs to be done to create "? ParameterValues"

DXCore (the free plugin framework on which CodeRush was built) allows you to create third party plugins that can work with CodeRush or stand alone using only DXCore. Such a plugin can be created to apply similar logic to one method or to all within a file, class, project or solution.

0


source







All Articles