Ejemplo n.º 1
0
        public static void Log(ErrorType errorType, string errMsg, DateTime time)
        {
            string errorLogMsg =
                "\r\n=============================================================\r\n" +
                "Error time: " + time.ToString() + "\r\n" +
                "Error type: " + errorType.ToText() +
                "\r\n-------------------------------------------------------------\r\n" +
                "\r\n" +
                errMsg +
                "\r\n=============================================================\r\n";

            try
            {
                using (StreamWriter sw = new StreamWriter(File.Open(FileNeme, FileMode.Append)))
                {
                    sw.Write(errorLogMsg);
                }
            }
            catch { }
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return(errorType.ToText() + (additionalData != null ? ": " + additionalData : ""));
 }