main
 1using System;
 2using System.IO;
 3using System.Threading;
 4using gorilla.commons.utility;
 5
 6namespace Gorilla.Commons.Infrastructure.Logging
 7{
 8    public class TextLogger : Logger
 9    {
10        readonly TextWriter writer;
11
12        public TextLogger(TextWriter writer)
13        {
14            this.writer = writer;
15        }
16
17        public void informational(string formatted_string, params object[] arguments)
18        {
19            writer.WriteLine(formatted_string, arguments);
20        }
21
22        public void debug(string formatted_string, params object[] arguments)
23        {
24            writer.WriteLine("[{0}] - {1}", Thread.CurrentThread.ManagedThreadId,
25                             formatted_string.format(arguments));
26        }
27
28        public void error(Exception e)
29        {
30            writer.WriteLine("{0}", e);
31        }
32    }
33}