Example #1
0
		public void WriteToLog (Message mess)
		{
			try {
				FileStream fs = new FileStream (logPath, FileMode.Append, FileAccess.Write, FileShare.Read);
				StreamWriter writer = new StreamWriter (fs);

				writer.WriteLine (mess.ToString ());
				writer.Flush ();
				fs.Close ();
			} catch (Exception ex) {
				Console.WriteLine (ex.Message);
			}
		}
Example #2
0
 public static void time(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(DateTime.Now);
 }
Example #3
0
 public static void space(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(" ");
 }
Example #4
0
 public static void number(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(Message.counter);
     Message.counter++;
 }
Example #5
0
 public static void nothing(Message message,  StreamWriter logWrite)
 {
     return;
 }
Example #6
0
 public static void message(Message message,  StreamWriter logWrite)
 {
     logWrite.WriteLine(message.message);
 }
Example #7
0
 public static void error(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(message.error);
 }