Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Pryor <jpryor@novell.com>2009-05-12 22:53:16 +0400
committerJonathan Pryor <jpryor@novell.com>2009-05-12 22:53:16 +0400
commit3b6088ff92dac155c8e2c045455bf98a8fd0748e (patch)
treef00c24892630030b89cc305f7c54cdab61a5b502 /mcs/class/System
parent95f93988d5ec2d651c90b46a1f723b560cdf287b (diff)
* System.Diagnostics/DiagnosticsConfigurationHandler.cs: Use the new
TraceSourceInfo(string, SourceLevels, TraceImplSettings) constructor. * System.Diagnostics/TraceSourceInfo.cs: Add a new constructor, TraceSourceInfo(string, SourceLevels, TraceImplSettings), which adds the DefaultTraceListener w/o depending upon (the possibly still initializing) TraceImpl members. Fixes #502944. * Test/test-config-file: Add a /configuration/system.diagnostics/source section to elicit the buggy behavior found in #502944. svn path=/trunk/mcs/; revision=133981
Diffstat (limited to 'mcs/class/System')
-rw-r--r--mcs/class/System/System.Diagnostics/ChangeLog9
-rw-r--r--mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs2
-rw-r--r--mcs/class/System/System.Diagnostics/TraceSourceInfo.cs11
-rw-r--r--mcs/class/System/Test/ChangeLog5
-rw-r--r--mcs/class/System/Test/test-config-file9
5 files changed, 34 insertions, 2 deletions
diff --git a/mcs/class/System/System.Diagnostics/ChangeLog b/mcs/class/System/System.Diagnostics/ChangeLog
index eac502fbab1..c96354eabd2 100644
--- a/mcs/class/System/System.Diagnostics/ChangeLog
+++ b/mcs/class/System/System.Diagnostics/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-12 Jonathan Pryor <jpryor@novell.com>
+
+ * DiagnosticsConfigurationHandler.cs: Use the new
+ TraceSourceInfo(string, SourceLevels, TraceImplSettings) constructor.
+ * TraceSourceInfo.cs: Add a new constructor,
+ TraceSourceInfo(string, SourceLevels, TraceImplSettings), which adds
+ the DefaultTraceListener w/o depending upon (the possibly still
+ initializing) TraceImpl members. Fixes #502944.
+
2009-05-01 Jonathan Pryor <jpryor@novell.com>
* DiagnosticsConfigurationHandler.cs: Don't refer to TraceImpl member
diff --git a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs b/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
index 8057cf0c7ca..aa5296cf262 100644
--- a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
+++ b/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
@@ -364,7 +364,7 @@ namespace System.Diagnostics
if (sources.ContainsKey (name))
return;
- TraceSourceInfo sinfo = new TraceSourceInfo (name, levels);
+ TraceSourceInfo sinfo = new TraceSourceInfo (name, levels, configValues);
sources.Add (sinfo.Name, sinfo);
foreach (XmlNode child in node.ChildNodes) {
diff --git a/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs b/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs
index 910e90becbe..c907d6046a8 100644
--- a/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs
+++ b/mcs/class/System/System.Diagnostics/TraceSourceInfo.cs
@@ -38,12 +38,21 @@ namespace System.Diagnostics
{
string name;
SourceLevels levels;
- TraceListenerCollection listeners = new TraceListenerCollection ();
+ TraceListenerCollection listeners;
public TraceSourceInfo (string name, SourceLevels levels)
{
this.name = name;
this.levels = levels;
+ this.listeners = new TraceListenerCollection ();
+ }
+
+ internal TraceSourceInfo (string name, SourceLevels levels, TraceImplSettings settings)
+ {
+ this.name = name;
+ this.levels = levels;
+ this.listeners = new TraceListenerCollection (false);
+ this.listeners.Add (new DefaultTraceListener(), settings);
}
public string Name {
diff --git a/mcs/class/System/Test/ChangeLog b/mcs/class/System/Test/ChangeLog
index 6807168467b..fd12e321456 100644
--- a/mcs/class/System/Test/ChangeLog
+++ b/mcs/class/System/Test/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-12 Jonathan Pryor <jpryor@novell.com>
+
+ * test-config-file: Add a /configuration/system.diagnostics/source
+ section to elicit the buggy behavior found in #502944.
+
2008-12-09 Christian Hergert <christian.hergert@gmail.com>
* System.Diagnostics/CounterCreationDataTest.cs: New test to verify
diff --git a/mcs/class/System/Test/test-config-file b/mcs/class/System/Test/test-config-file
index d2eea338663..03940481236 100644
--- a/mcs/class/System/Test/test-config-file
+++ b/mcs/class/System/Test/test-config-file
@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
+ <sources>
+ <source name="source1" switchName="switch" switchType="System.Diagnostics.SourceSwitch">
+ <!--
+ <listeners>
+ <add name="console" type="System.Diagnostics.ConsoleTraceListener"/>
+ </listeners>
+ -->
+ </source>
+ </sources>
<switches>
<!-- Boolean switches: any non-zero value is true -->
<add name="bool-true" value="1"/>