From: John R. Hicks Date: Fri, 4 Jan 2002 11:34:11 +0000 (-0000) Subject: Moved files to System assembly. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=0c9931a0aee273f8dd0852dfc29f969394a63c95;p=mono.git Moved files to System assembly. svn path=/trunk/mcs/; revision=1811 --- diff --git a/mcs/class/corlib/System.Diagnostics/ChangeLog b/mcs/class/corlib/System.Diagnostics/ChangeLog index 673bec7d580..e4cc22b3fce 100644 --- a/mcs/class/corlib/System.Diagnostics/ChangeLog +++ b/mcs/class/corlib/System.Diagnostics/ChangeLog @@ -1,3 +1,7 @@ +2002-01-04 John R. Hicks + * Moved TraceListener, TextWriterTraceListener, and + DefaultTraceListener to System assembly....oops. + 2002-01-04 John R. Hicks * Added TextWriterTraceListener.cs, TraceListener.cs, and diff --git a/mcs/class/corlib/System.Diagnostics/DefaultTraceListener.cs b/mcs/class/corlib/System.Diagnostics/DefaultTraceListener.cs deleted file mode 100644 index fc0ee84a3f1..00000000000 --- a/mcs/class/corlib/System.Diagnostics/DefaultTraceListener.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// System.Diagnostics.DefaultTraceListener.cs -// -// Author: -// John R. Hicks (angryjohn69@nc.rr.com) -// -// (C) 2001 -// -using System; - -namespace System.Diagnostics -{ - /// - /// Provides the default output methods and behavior for tracing. - /// - /// - /// Since there is no debugging API ala Win32 on Mono, - /// Console.Out is being used as the default output method. - /// - public class DefaultTraceListener : TraceListener - { - private string logFileName; - - public DefaultTraceListener() : base("Default") - { - logFileName = ""; - } - - /// - /// Gets or sets name of a log file to write trace or debug messages to. - /// - /// - /// The name of a log file to write trace or debug messages to. - /// - public String LogFileName - { - get - { - return logFileName; - } - set - { - logFileName = value; - } - } - - /// - /// Emits or displays a message and a stack trace for an assertion that - /// always fails. - /// - /// - /// The message to emit or display. - /// - public override void Fail(string message) - { - Console.Out.WriteLine(message); - new StackTrace().ToString(); - } - - /// - /// Emits or displays detailed messages and a stack trace - /// for an assertion that always fails. - /// - /// - /// The message to emit or display - /// - /// - /// The detailed message to emit or display. - /// - public override void Fail(string message, string detailMessage) - { - Console.Out.WriteLine(message + ": " + detailMessage); - new StackTrace().ToString(); - } - - /// - /// Writes the output to the Console - /// - /// - /// The message to write - /// - public override void Write(string message) - { - Console.Out.Write(message); - } - - /// - /// Writes the output to the Console, followed by a newline - /// - /// - /// The message to write - /// - public override void WriteLine(string message) - { - Console.Out.WriteLine(message); - } - } -} diff --git a/mcs/class/corlib/System.Diagnostics/TextWriterTraceListener.cs b/mcs/class/corlib/System.Diagnostics/TextWriterTraceListener.cs deleted file mode 100644 index fe362d68520..00000000000 --- a/mcs/class/corlib/System.Diagnostics/TextWriterTraceListener.cs +++ /dev/null @@ -1,227 +0,0 @@ -// -// System.Diagnostics.TextWriterTraceListener.cs -// -// Author: -// John R. Hicks (angryjohn69@nc.rr.com) -// -// (C) 2001 -// -namespace System.Diagnostics -{ - using System; - using System.IO; - using System.Text; - - /// - /// Directs tracing or debugging output to a - /// TextWriter or to a Stream, - /// such as Console.Out or - /// FileStream. - /// - public class TextWriterTraceListener : TraceListener - { - - private TextWriter writer; - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class with - /// TextWriter as the output recipient. - /// - public TextWriterTraceListener() : base("TextWriter") - { - writer = Console.Out; - } - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class, using the stream as the output - /// recipient of the debugging and tracing output. - /// - /// - /// A Stream that represents the stream the - /// TextWriterTraceListener writes to. - /// - /// - /// The stream is a null reference. - /// - public TextWriterTraceListener(Stream stream) : base("") - { - if(stream == null) - throw new ArgumentNullException("Stream is null"); - - writer = new StreamWriter(stream); - } - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class, using the file as the recipient - /// of the debugging and tracing output. - /// - /// - /// The name of the file the - /// TextWriterTraceListener writes to. - /// - /// - /// The fileName is null. - /// - public TextWriterTraceListener(string fileName) : base("") - { - if(fileName == null) - throw new ArgumentNullException("Filename is null"); - - FileStream fileStream = new FileStream(fileName, FileMode.Create); - writer = new StreamWriter(fileStream); - } - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class using the specified writer as the - /// recipient of the tracing or debugging output. - /// - /// - /// A TextWriter that receives output - /// from the TextWriterTraceListener. - /// - /// - /// The writer is a null reference - /// - public TextWriterTraceListener(TextWriter writer) : base("") - { - if(writer == null) - throw new ArgumentNullException("Given TextWriter is null"); - this.writer = writer; - } - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class with the specified name, using the - /// stream as the recipient of the tracing or debugging output. - /// - /// - /// A Stream that represents the stream the - /// TextWriterTraceListener - /// writes to. - /// - /// - /// The name of the new instance - /// - /// - /// The stream is a null reference - /// - public TextWriterTraceListener(Stream stream, string name) : base(name) - { - if(stream == null) - throw new ArgumentNullException("Supplied Stream is null"); - writer = new StreamWriter(stream); - } - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class with the specified name, using the - /// file as the recipient of the tracing or debugging output. - /// - /// - /// The name of the file the - /// TextWriterTraceListener writes to. - /// - /// - /// The name of the new instance - /// - /// - /// The file is a null reference. - /// - public TextWriterTraceListener(string fileName, string name) : base(name) - { - if(fileName == null) - throw new ArgumentNullException("Supplied file name is null"); - FileStream fileStream = new FileStream(fileName, FileMode.Create); - writer = new StreamWriter(fileStream); - } - - /// - /// Initializes a new instance of the - /// TextWriterTraceListener class with the specified name, using - /// the specified writer as the recipient of the tracing or debugging output. - /// - /// - /// A TextWriter that receives the output - /// from the TextWriterTraceListener. - /// - /// - /// The name of the new instance. - /// - /// - /// The writer is a null reference. - /// - public TextWriterTraceListener(TextWriter writer, string name) : base(name) - { - if(writer == null) - throw new ArgumentNullException("The supplied writer is null"); - this.writer = writer; - } - - /// - /// Gets or sets the writer that receives the debugging or tracing output. - /// - /// - /// A TextWriter that represents the writer - /// that receives the tracing or debugging output. - /// - public TextWriter Writer - { - get - { - return writer; - } - set - { - writer = value; - } - } - - /// - /// Closes the Writer so that it no longer - /// receives tracing or debugging output. - /// - public override void Close() - { - writer.Close(); - } - - /// - /// Flushes the output buffer for the Writer. - /// - public override void Flush() - { - writer.Flush(); - } - - /// - /// Writes a message to this instance's Writer. - /// - /// - /// A message to write. - /// - public override void Write(string message) - { - Console.Error.WriteLine("We should be getting output here"); - writer.Write(message); - - } - - /// - /// Writes a message to this instance's Writer - /// followed by a line terminator. - /// - /// - /// A message to write. - /// - public override void WriteLine(string message) - { - Console.Error.WriteLine("We should be getting output here, too"); - writer.WriteLine(message); - - } - } -} diff --git a/mcs/class/corlib/System.Diagnostics/TraceListener.cs b/mcs/class/corlib/System.Diagnostics/TraceListener.cs deleted file mode 100644 index f7508fa1452..00000000000 --- a/mcs/class/corlib/System.Diagnostics/TraceListener.cs +++ /dev/null @@ -1,300 +0,0 @@ -// -// System.Diagnostics.TraceListener.cs -// -// Author: -// John R. Hicks (angryjohn69@nc.rr.com) -// -// (C) 2001 -// -namespace System.Diagnostics -{ - using System; - using System.IO; - using System.Text; - - /// - /// Provides the abstract base class for the listeners who monitor - /// trace and debug output - /// - public abstract class TraceListener : MarshalByRefObject, IDisposable - { - private int indentLevel; - private int indentSize; - private string name; - private bool needIndent; - - /// - /// Initializes a new instance of the - /// TraceListener class. - /// - protected TraceListener() - { - indentLevel = 0; - indentSize = 4; - needIndent = false; - name = ""; - } - - /// - /// Initializes a new instance of the - /// TraceListener class using the specified name as the listener. - /// - protected TraceListener(string name) : this() - { - if(name == null) - this.name = ""; - this.name = name; - } - - /// - /// Gets or sets the indent level. - /// - /// - /// The indent level. The default is zero. - /// - public int IndentLevel - { - get - { - return indentLevel; - } - set - { - indentLevel = value; - } - } - - /// - /// Gets or sets the number of spaces in an indent. - /// - /// - /// The number of spaces in an indent. The default is four spaces. - /// - public int IndentSize - { - get - { - return indentSize; - } - set - { - indentSize = value; - } - } - - /// - /// Gets or sets a name for this TraceListener. - /// - /// - /// A name for this TraceListener. - /// The default is the empty string ("") - /// - public string Name - { - get - { - return name; - } - set - { - name = value; - } - } - - /// - /// Gets or sets a value indicating whether to indent the output. - /// - /// - /// true if the output should be indented; otherwise false. - /// - protected bool NeedIndent - { - get - { - return needIndent; - } - set - { - needIndent = value; - } - } - - /// - /// When overridden in a derived class, closes the output stream so it no longer - /// receives tracing or debugging output. - /// - public virtual void Close() {} - - /// - /// Releases all resources used by the TraceListener. - /// - public virtual void Dispose() {} - - /// - /// Releases the unmanaged resources used by the - /// TraceListener and optionally releases the - /// managed resources. - /// - /// - /// true to release both managed and unmanaged resources; - /// false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) {} - - /// - /// Emits an error message to the listener you create when you - /// implement the TraceListener class. - /// - /// - /// A message to emit. - /// - public virtual void Fail(string message) - { - - } - - /// - /// Emits an error message, and a detailed error message to the listener - /// you create when you implement the TraceListener - /// class. - /// - /// - /// A message to emit. - /// - /// - /// A detailed message to emit. - /// - public virtual void Fail(string message, string detailMessage) - { - - } - - /// - /// When overridden in a derived class, flushes the output buffer. - /// - public virtual void Flush() {} - - /// - /// Writes the value of the object's ToString - /// method to the listener you create when you implement the - /// TraceListener class. - /// - /// - /// An Object whose fully qualified - /// class name you want to write. - /// - public virtual void Write(object o) - { - - } - - /// - /// When overridden in a derived class, writes the specified message to - /// the listener you create in the derived class. - /// - /// - /// A message to write. - /// - public abstract void Write(string message); - - /// - /// Writes a category name and the value of the object's - /// ToString - /// method to the listener you create when you implement the - /// TraceListener class. - /// - /// - /// An Object whose fully qualified - /// class name you wish to write. - /// - /// - /// A category name used to organize the output. - /// - public virtual void Write(object o, string category) - { - - } - - /// - /// Writes a category name and a message to the listener you create when - /// you implement the TraceListener class. - /// - /// - /// A message to write. - /// - /// - /// A category name used to organize the output. - /// - public virtual void Write(string message, string category) - { - - } - - /// - /// Writes the value of the object's ToString - /// method to the listener you create when you implement the - /// TraceListener class, followed by a line terminator. - /// - /// - /// An Object whose fully qualified - /// class name you want to write. - /// - public virtual void WriteLine(object o) - { - - } - - /// - /// When overridden in a derived class, writes the specified message to - /// the listener you create in the derived class, followed by a line terminator. - /// - /// - /// A message to write. - /// - public abstract void WriteLine(string message); - - /// - /// Writes a category name and the value of the object's - /// ToString - /// method to the listener you create when you implement the - /// TraceListener class, followed by a - /// line terminator. - /// - /// - /// An Object whose fully qualified - /// class name you wish to write. - /// - /// - /// A category name used to organize the output. - /// - public virtual void WriteLine(object o, string category) - { - - } - - /// - /// Writes a category name and a message to the listener you create when - /// you implement the TraceListener class, - /// followed by a line terminator. - /// - /// - /// A message to write. - /// - /// - /// A category name used to organize the output. - /// - public virtual void WriteLine(string message, string category) - { - - } - - /// - /// Writes the indent to the listener you create when you implement this class, - /// and resets the NeedIndent Property to false. - /// - protected virtual void WriteIndent() - { - - } - } -}