Klasa logująca w C#

by Nazgul

Chcia­łem zapre­zen­to­wać moją klasę uła­twia­jącą obsługę logo­wa­nia w .NET, klasa ta napi­sana jest w c# jak suge­ruje tytuł (:
Kod umiesz­czam na licen­cji cc by

using System;
using System.Collections.Generic;
using System.IO;

namespace Nazgul.Helpers
{
    //Enumeracja priorytetów
    public enum LogPriority{
        Exception,
        Error,
        Normal,
        Log
    }

    public class Log
    {
        //Klasa przechowująca TextWriter oraz jego priorytet.
        protected sealed class LogStream
        {
            public TextWriter Out { get; set; }
            public LogPriority Priority { get; set; }
        }

        List<logstream> outs = new List<logstream>(5);      //Lista strumieni
        LogPriority currentPriority = LogPriority.Error;    //Bieżący priorytet
        static readonly Log instance = new Log();

        public static Log Instance
        {
            get{ return instance; }
        }

        //Konstruktory dla singletonu.
        static Log(){}
        Log() { }

        //Funkcja dodaje strumień do kolekcji
        public Log RegisterStream(Stream stream, LogPriority priority)
        {
            if (stream != null)
            {
                outs.AddRange(new LogStream[] { new LogStream() { Out = new StreamWriter(stream), Priority = priority } });
            }
            return this;
        }

        public Log RegisterStream(Stream stream)
        {
            this.RegisterStream(stream, LogPriority.Log);
        }

        public Log RegisterStream(TextWriter tw, LogPriority priority)
        {
            if (tw != null)
            {
                outs.AddRange(new LogStream[] { new LogStream() { Out = tw, Priority = priority } });
            }
            return this;
        }

        public Log RegisterStream(TextWriter tw)
        {
            this.RegisterStream(tw, LogPriority.Log);
        }

        public Log SetPriority(LogPriority prior)
        {
            this.currentPriority = prior;
            return this;
        }

        private void Write(string text)
        {
            foreach (LogStream ls in this.outs)
            {
                if (this.currentPriority >= ls.Priority)
                {
                    ls.Out.Write(text);
                    ls.Out.Flush();
                }
            }
        }

        public Log EndLine()
        {
            this.Write(Environment.NewLine);
            return this;
        }

        public Log Message(string text)
        {
            this.Write(text);
            return this;
        }

        public Log Message(Exception ext)
        {
            //Tutaj należy dodać kod w lepszy sposób opisujacy wyjatek.
            this.Write(ext.ToString());

            return this;
        }
    }
}