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?
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.
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.
TraceSource is the newer version (since .NET 2) and Trace is the older version, more info is available here:
Clarification on TraceSource/Trace
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With