0

Is there an alternative to tracing in C#/.net ?

I'm speaking about the Microsoft tracing class.

I don't like how tracing adds some many extra lines of code, making it harder to read. It does make debugging easier when our operation guys simply send us the trace. The other alternative that I see is printing the stack trace error in the event log, but this isn't as descriptive.

Is there another option, where I can get the debugging verbosity of a Trace, without having the verbosity in my code ?

helb
  • 7,609
  • 8
  • 36
  • 58
guiomie
  • 4,988
  • 6
  • 37
  • 67
  • 1
    Possible search term "logging as cross-cutting concern"... I.e. check out http://stackoverflow.com/questions/11533354/microsoft-unity-the-difference-between-interface-interception-and-constructor-in – Alexei Levenkov Nov 25 '13 at 20:11

1 Answers1

4

You could use something like PostSharp's Tracing to inject the tracing code throughout your project at method boundaries without having to explicitly add the Trace.Write calls within your code.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • Thanks, this seems to be the only option. The only issue is that it is limited by saying when a method is called and ended... – guiomie Dec 05 '13 at 21:36