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 { } }
public override string ToString() { return(errorType.ToText() + (additionalData != null ? ": " + additionalData : "")); }