Exemplo n.º 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);
			}
		}
Exemplo n.º 2
0
 public static void time(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(DateTime.Now);
 }
Exemplo n.º 3
0
 public static void space(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(" ");
 }
Exemplo n.º 4
0
 public static void number(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(Message.counter);
     Message.counter++;
 }
Exemplo n.º 5
0
 public static void nothing(Message message,  StreamWriter logWrite)
 {
     return;
 }
Exemplo n.º 6
0
 public static void message(Message message,  StreamWriter logWrite)
 {
     logWrite.WriteLine(message.message);
 }
Exemplo n.º 7
0
 public static void error(Message message, StreamWriter logWrite)
 {
     logWrite.WriteLine(message.error);
 }