public IEnumerable<LogEntry> GetLogEntries(string id)
{
ITracer tracer = _traceFactory.GetTracer();
using (tracer.Step($"DeploymentManager.GetLogEntries(id:{id})"))
{
string path = GetLogPath(id, ensureDirectory: false);
if (!FileSystemHelpers.FileExists(path))
{
throw new FileNotFoundException(String.Format(CultureInfo.CurrentCulture, Resources.Error_NoLogFound, id));
}
VerifyDeployment(id, IsDeploying);
var logger = GetLoggerForFile(path);
List<LogEntry> entries = logger.GetLogEntries().ToList();
// Determine if there's details to show at all
foreach (var e in entries)
{
e.HasDetails = logger.GetLogEntryDetails(e.Id).Any();
}
return entries;
}
}