public string Read(EnumeratorDirection direction) { CircularArray buffer = new CircularArray(maxLines); using (Stream stream = OpenFile()) { using (StreamReader reader = new StreamReader(stream)) { string line; while ((line = reader.ReadLine()) != null) { buffer.Add(line); } } } return buffer.ToString(direction); }
public string Read(EnumeratorDirection direction) { CircularArray buffer = new CircularArray(maxLines); using (Stream stream = OpenFile()) { using (StreamReader reader = new StreamReader(stream)) { string line; while ((line = reader.ReadLine()) != null) { buffer.Add(line); } } } return(buffer.ToString(direction)); }
private string Read(EnumeratorDirection direction, string match) { CircularArray buffer = new CircularArray(maxLines); using (Stream stream = OpenFile()) { using (StreamReader reader = new StreamReader(stream,System.Text.Encoding.Default)) { string line; while ((line = reader.ReadLine()) != null) { if (match == null || line.IndexOf(match) >= 0) buffer.Add(line); // TODO: Messages can contain embedded newlines (e.g., exception reports). // TODO: This code should be changed to capture those "follow on" lines as well. } } } return buffer.ToString(direction); }
private string Read(EnumeratorDirection direction, string match) { CircularArray buffer = new CircularArray(maxLines); using (Stream stream = OpenFile()) { using (StreamReader reader = new StreamReader(stream, System.Text.Encoding.Default)) { string line; while ((line = reader.ReadLine()) != null) { if (match == null || line.IndexOf(match) >= 0) { buffer.Add(line); } // TODO: Messages can contain embedded newlines (e.g., exception reports). // TODO: This code should be changed to capture those "follow on" lines as well. } } } return(buffer.ToString(direction)); }