diff options
author | Jonathan Pryor <jpryor@novell.com> | 2002-06-16 23:49:45 +0400 |
---|---|---|
committer | Jonathan Pryor <jpryor@novell.com> | 2002-06-16 23:49:45 +0400 |
commit | 609c2de3e6f6b94460637e5175b0bdbb6692c997 (patch) | |
tree | 2301cd6dc95e8fb2538ee1623efb38bbf513f3de /mcs/class/System/System.Diagnostics/TraceImpl.cs | |
parent | 9a16ca4210018c668b82c4d5771bf8cdf42f1349 (diff) |
* ICollectData.cs: Implemented
* TraceImpl.cs: Setting IndentLevel, IndentSize should change the
corresponding properties on all current TraceListeners.
Also, to answer the FIXME message: Yes, the properties in TraceListener
need to be [ThreadStatic] as well.
* TraceListenerCollection.cs: When adding a TraceListener, the TraceListener
should have its properties set to the current TraceImpl property values.
* TraceListener.cs: Make indentSize, lndentLevel [ThreadStatic].
svn path=/trunk/mcs/; revision=5291
Diffstat (limited to 'mcs/class/System/System.Diagnostics/TraceImpl.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/TraceImpl.cs | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/mcs/class/System/System.Diagnostics/TraceImpl.cs b/mcs/class/System/System.Diagnostics/TraceImpl.cs index e2fe2022485..f159f2518c4 100644 --- a/mcs/class/System/System.Diagnostics/TraceImpl.cs +++ b/mcs/class/System/System.Diagnostics/TraceImpl.cs @@ -24,34 +24,36 @@ namespace System.Diagnostics { set {autoFlush = value;} } - // FIXME: From MSDN: "This property is stored on - // per-thread/pre-reqeust basis" - // - // What exactly does this mean? Sure, we can mark it - // [ThreadStatic], which make a per-thread value, but what - // does this mean for each of the writers? Do *they* need to - // store this as a thread-static value? - [MonoTODO, ThreadStatic] + [ThreadStatic] private static int indentLevel = 0; public static int IndentLevel { get {return indentLevel;} - set {indentLevel = value;} + set { + indentLevel = value; + + // Don't need to lock for threadsafety as + // TraceListener.IndentLevel is [ThreadStatic] + foreach (TraceListener t in Listeners) { + t.IndentLevel = indentLevel; + } + } } - // FIXME: From MSDN: "This property is stored on - // per-thread/pre-reqeust basis" - // - // What exactly does this mean? Sure, we can mark it - // [ThreadStatic], which makes a per-thread value, but what - // does this mean for each of the writers? Do *they* need to - // store this as a thread-static value? - [MonoTODO, ThreadStatic] + [ThreadStatic] private static int indentSize = 4; public static int IndentSize { get {return indentSize;} - set {indentSize = value;} + set { + indentSize = value; + + // Don't need to lock for threadsafety as + // TraceListener.IndentSize is [ThreadStatic] + foreach (TraceListener t in Listeners) { + t.IndentSize = indentSize; + } + } } private static TraceListenerCollection listeners = |