示例#1
0
 public void Write(ILoggerMessage message)
 {
     using (StreamWriter sw = new StreamWriter(_file, true, Encoding.Default))
     {
         sw.WriteLine(message.ToString());
     }
 }
示例#2
0
 public void Write(ILoggerMessage message)
 {
     //thread safe
     lock (lockobject)
     {
         using StreamWriter sw = File.AppendText(_file);
         sw.WriteLine(message.ToString());
     }
 }
示例#3
0
 public void Write(ILoggerMessage message)
 {
     Console.WriteLine(message.ToString());
 }
示例#4
0
 public void Write(ILoggerMessage message)
 {
     File.AppendAllText(FileName, message.ToString() + "\r\n");
 }