2 using System.Collections.Generic;
5 using Seci.Definitions;
13 internal static class ErrorLogger
20 internal static void SeciError(String source, Exception e)
22 String fileName = setupPaths(
false);
24 writeError(source, e.Message, fileName);
32 internal static void LabViewError(String source, String message)
34 String fileName = setupPaths(
true);
36 writeError(source, message, fileName);
46 private static String setupPaths(Boolean isLabView)
50 return Status.LabViewErrorDir +
"\\" + DateTime.Today.Year +
"_" + DateTime.Now.ToString(
"MMM") +
"_" + DateTime.Today.Day +
".txt";
53 String directory = Status.ErrorDir;
54 String fileName = directory +
"\\" + DateTime.Today.Year +
"_" + DateTime.Now.ToString(
"MMM") +
"_" + DateTime.Today.Day +
".txt";
66 private static void writeError(String source, String message, String fileName)
71 String error = message;
72 error = error.Replace(
'\n',
' ');
75 StreamWriter SW =
new StreamWriter(fileName,
true);
76 SW.WriteLine(DateTime.Now.ToLongTimeString() +
" SOURCE: " + source + Environment.NewLine + error + Environment.NewLine);