T
Trace User
Hello,
I have a design question regarding Tracing and Trace
Switches.
I understand that Trace Switches can be configured through
an application's .config file. When a switch is
instantiated, the application automatically checks the
configuration file for a matching named switch. If there's
a match, the configuration parameters are set.
My question is this: In a non-trivial application that
spans several classes and several modules, would you
declare and instantiate a single trace switch that gets
passed throughout the application where needed? Or would
you declare and instantiate unique switches within the
classes they are needed, making use of the common name
that appears in the .config file.
E.g. Application with 3 classes - Controller, Alpha, and
Beta. Tracing is required in Alpha and Beta.
Would you declare the trace switch in Controller and pass
reference to Alpha and Beta?
OR
Would you declare individual switches in both Alpha and
Beta where required?
Sincerely,
Trace User
I have a design question regarding Tracing and Trace
Switches.
I understand that Trace Switches can be configured through
an application's .config file. When a switch is
instantiated, the application automatically checks the
configuration file for a matching named switch. If there's
a match, the configuration parameters are set.
My question is this: In a non-trivial application that
spans several classes and several modules, would you
declare and instantiate a single trace switch that gets
passed throughout the application where needed? Or would
you declare and instantiate unique switches within the
classes they are needed, making use of the common name
that appears in the .config file.
E.g. Application with 3 classes - Controller, Alpha, and
Beta. Tracing is required in Alpha and Beta.
Would you declare the trace switch in Controller and pass
reference to Alpha and Beta?
OR
Would you declare individual switches in both Alpha and
Beta where required?
Sincerely,
Trace User