views:

49

answers:

3

I'm working on a bug where we have a use case that works, and a subtly different use case that doesn't. The code base has next to no logging, and I don't want to spend time now sprinkling logging throught the code base, though I do have time budgeted to do that at a later date.

Is there a tool that logs a program's actions ie, logs each function call?

Apparently Appsight does do this but costs 100,000's.

A: 

You could try using our logging tool SmartInspect together with the aspect oriented programming (AOP) framework PostSharp. By using our aspect library, you can automatically instrument and log all method calls, exceptions and even field/property changes.

Dennis G.
A: 

A solution that doesn't require any code change / recompile would be to use a tool that's based on the .NET Profiling API, which injects its hooks at runtime.

The only free-open-source project i know that traces not just method entry/exit but also the return values/method parameters is SAE (Simple Assembly Explorer). When you open it up, just navigate to your exe, right click on it, and choose Profile.

There are some limits to this tool - specifically, it won't print out the values of generic types, and the text output is not indented/prettified.

Omer Raviv
A: 

Runtime Flow can log each function call with parameters for .NET 2.0 - 4.0 applications without any additional instrumentation.

Sergey Vlasov