Trace.IsEnabled

  • Thread starter Thread starter Tiësto
  • Start date Start date
T

Tiësto

Should I always check if Trace is enabled before attempting to use
Trace.Write or Trace.Warn? will it throw an exception if I don't? will It
make thing slower if I write entries in the trace when I haven't trace
enabled neither at application level nor page level?

Another Question: Is there any easy automatic way to see the full code
execution path for a given request? I would like to see all of the members
that were accessed and the order.

Thanks in advance!
 
You don't need to check Trace.IsEnabled prior to writing out trace messages,
hough if you're going to do any sort of significant work to build the trace
message then you can avoid that work by checking the IsEnabled first.

As for the full code execution path, I'd suggest getting a code analyzer
to do this. Reflector sort of does this. It's a great tool to have if you
don't already.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
thanks for your answer, I've heard about Reflector, but I think I never
really needed it. I'll have it in mind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Tracing 1
System.Diagnostics.Trace.Write() doesn't work in ASP.NET apps 1
Trace class 3
trust level problem 1
Security Exception 1
Object not working on pageback 1
ASP.Net timeouts 3
Failed to access IIS metabase 2

Back
Top