00001 using System; 00002 00003 namespace SmartDeviceGUIClient 00004 { 00008 public class MessageLogger { 00009 private System.IO.TextWriter writer; 00010 public MessageLogger(System.IO.TextWriter loggerOutput) { 00011 writer = loggerOutput; 00012 } 00013 00014 public void Log(string s) { 00015 writer.WriteLine(" " + s); 00016 } 00017 public void Log(string s, params object[] args) { 00018 writer.WriteLine(" " + s, args); 00019 } 00020 public void LogError(string s) { 00021 writer.WriteLine("*** " + s); 00022 } 00023 public void LogError(string s, params object[] args) { 00024 writer.WriteLine("*** " + s, args); 00025 } 00026 public void LogTodo(string s) { 00027 writer.WriteLine("### " + s); 00028 } 00029 public void LogTodo(string s, params object[] args) { 00030 LogTodo(String.Format(s, args)); 00031 } 00032 public void LogStartBegin(string deviceStarting) { 00033 writer.WriteLine("+++ Starting " + deviceStarting); 00034 } 00035 public void LogStartComplete(string deviceStarted) { 00036 writer.WriteLine("+++ " + deviceStarted + " Started"); 00037 } 00038 00039 public void LogSend(string s) { 00040 writer.WriteLine(">>> " + s); 00041 } 00042 public void LogSend(string s, params object[] args) { 00043 LogSend(String.Format(s, args)); 00044 } 00045 } 00046 }