/// <summary> /// Reads the log file from the given path and returns a new <see cref="LegacyLog"/> object. /// </summary> /// <param name="path">The log file path.</param> /// <returns>A new <see cref="LegacyLog"/> object.</returns> public static LegacyLog Read(string path) { using (var textReader = new StreamReader(path)) using (var reader = new LegacyLogTextReader(textReader)) { var log = new LegacyLog(); log.Read(reader); return(log); } }
/// <summary> /// Reads the log file asynchronously from the given path and returns a new <see cref="LegacyLog"/> object. /// </summary> /// <param name="path">The log file path.</param> /// <returns>A new <see cref="LegacyLog"/> object.</returns> public static async Task <LegacyLog> ReadAsync(string path) { using (var textReader = new StreamReader(path)) using (var reader = new LegacyLogTextReader(textReader)) { var log = new LegacyLog(); await log.ReadAsync(reader).ConfigureAwait(false); return(log); } }