public static void WriteToLocalLog(string message) {
lock (Utils.locker) {
string path = Path.Combine(Application.Current.WorkingDirectory, "warehouse.log");
// This text is added only once to the file.
if (!File.Exists(path)) {
// Create a file to write to.
using (StreamWriter sw = File.CreateText(path)) {
sw.WriteLine(message);
}
return;
}
using (StreamWriter sw = File.AppendText(path)) {
sw.WriteLine(message);
}
}
}