Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between using Trace and TraceSource

Anyone knows the difference between System.Diagnostic.Trace and System.Diagnostic.TraceSource classes?

I've been using Trace for most of my projects and I just happen to found out about TraceSource the other day. They seems to offer similar API, is one better than the other?

like image 505
oscarkuo Avatar asked Jul 08 '09 23:07

oscarkuo


People also ask

What is TraceSource?

TraceSource provides tracing methods that allow you to easily trace events, trace data, and issue informational traces. In . NET Framework apps, trace output from TraceSource can be controlled by configuration file settings.

What is the use of trace class?

Tracing helps you isolate problems and fix them without disturbing a running system. This class provides methods to display an Assert dialog box, and to emit an assertion that will always Fail. This class provides write methods in the following variations: Write.


1 Answers

TraceSource is the newer version (since .NET 2) and Trace is the older version, more info is available here:

Clarification on TraceSource/Trace

like image 186
Steve Temple Avatar answered Oct 15 '22 16:10

Steve Temple