Logger
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
public class Logger
{
public static void WriteLog(string message)
{
string logText = string.Format("{0}\t{1}", DateTime.Now, message);
string logPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\QReminder\log.txt";
using (StreamWriter sw = new StreamWriter(logPath, true))
{
sw.WriteLine(logText);
sw.Close();
}
}
}
Related examples in the same category