void logNewErrors() { if (!String.Equals(current_error, last_error)) { char[] trimchars = { '-', '\n', ' ' }; string cleanerror = current_error.Trim(trimchars); if (!String.IsNullOrEmpty(cleanerror)) { ProgramLogger.LogError(cleanerror); } last_error = current_error; } }