public static string GetTextFileContents(string file)
{
// thanks to http://answers.unity3d.com/questions/167518/reading-editorlog-in-the-editor.html
FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader sr = new StreamReader(fs);
string contents = "";
if (fs != null && sr != null)
{
contents = sr.ReadToEnd();
}
fs.Close();
return contents;
}