Пример #1
0
        public async Task <IEnumerable <LogEntry> > GetEntries()
        {
            var logItem = new LogItem();

            logItem.Name = Name;

            if (!string.IsNullOrEmpty(_logFilePath))
            {
                using (var stream = File.OpenText(_logFilePath))
                {
                    var json = await stream.ReadLineAsync();

                    while (!string.IsNullOrEmpty(json))
                    {
                        logItem.Entries.Add(_entryProvider.GetEntry(json));
                        json = await stream.ReadLineAsync();
                    }
                }
            }

            return(logItem.Entries);
        }