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); } }
public static void time(Message message, StreamWriter logWrite) { logWrite.WriteLine(DateTime.Now); }
public static void space(Message message, StreamWriter logWrite) { logWrite.WriteLine(" "); }
public static void number(Message message, StreamWriter logWrite) { logWrite.WriteLine(Message.counter); Message.counter++; }
public static void nothing(Message message, StreamWriter logWrite) { return; }
public static void message(Message message, StreamWriter logWrite) { logWrite.WriteLine(message.message); }
public static void error(Message message, StreamWriter logWrite) { logWrite.WriteLine(message.error); }