Skip to content

Commit

Permalink
Add more logging to NuGet package installer
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Jun 29, 2016
1 parent ff508d3 commit abf4967
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Cake.NuGet/NuGetPackageInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,18 @@ public IReadOnlyCollection<IFile> Install(PackageReference package, PackageType
{
Arguments = GetArguments(package, path),
RedirectStandardOutput = true,
Silent = true
Silent = _log.Verbosity < Verbosity.Diagnostic
});
process.WaitForExit();

var exitCode = process.GetExitCode();
if (exitCode != 0)
{
_log.Warning("NuGet exited with {0}", exitCode);
var output = string.Join(Environment.NewLine, process.GetStandardOutput());
_log.Verbose(Verbosity.Diagnostic, "Output:\r\n{0}", output);
}

// Return the files.
return _contentResolver.GetFiles(packagePath, type);
}
Expand Down

0 comments on commit abf4967

Please sign in to comment.