Thumbnail file hits. Based on a patch from D Bera
[beagle.git] / bludgeon / Log.cs
blob4af87a1eb950362b06822771876496dca6bd49ff
2 using System;
3 using System.IO;
4 using System.Text;
6 namespace Bludgeon {
8 public class Log {
10 static TextWriter console = Console.Out;
11 static TextWriter file = null;
13 static private void Write (string prefix, string format, params object [] args)
15 string message;
16 message = prefix + " " + String.Format (format, args);
18 if (console != null)
19 console.WriteLine (message);
21 if (file != null) {
22 file.WriteLine (message);
23 file.Flush ();
27 static public void Create (string path)
29 file = new StreamWriter (path);
32 static public void Spew (string format, params object [] args)
34 Write ("---", format, args);
37 static public void Info (string format, params object [] args)
39 Write ("+++", format, args);
42 static public void Failure (string format, params object [] args)
44 Write ("***", format, args);