Skip to content

Commit

Permalink
(GH-187) Show log file path in messages.
Browse files Browse the repository at this point in the history
When including the message "See the log for details", be sure to
include the path to the log file.
  • Loading branch information
ferventcoder committed Apr 13, 2015
1 parent 346c050 commit e683783
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,15 @@ public ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfigu

var installFailures = packageInstalls.Count(p => !p.Value.Success);
var installWarnings = packageInstalls.Count(p => p.Value.Warning);
this.Log().Warn(() => @"{0}{1} installed {2}/{3} package(s). {4} package(s) failed.{5}{0} See the log for details.".format_with(
this.Log().Warn(() => @"{0}{1} installed {2}/{3} package(s). {4} package(s) failed.{5}{0} See the log for details ({6}).".format_with(
Environment.NewLine,
ApplicationParameters.Name,
packageInstalls.Count(p => p.Value.Success && !p.Value.Inconclusive),
packageInstalls.Count,
installFailures,
installWarnings == 0 ? string.Empty : "{0} {1} package(s) had warnings.".format_with(Environment.NewLine, installWarnings)));
installWarnings == 0 ? string.Empty : "{0} {1} package(s) had warnings.".format_with(Environment.NewLine, installWarnings),
_fileSystem.combine_paths(ApplicationParameters.LoggingLocation,ApplicationParameters.LoggingFile)
));

if (installWarnings != 0)
{
Expand Down Expand Up @@ -333,12 +335,14 @@ public void upgrade_noop(ChocolateyConfiguration config)
if (config.RegularOutput)
{
var upgradeWarnings = noopUpgrades.Count(p => p.Value.Warning);
this.Log().Warn(() => @"{0}{1} can upgrade {2}/{3} package(s). {4}{0} See the log for details.".format_with(
this.Log().Warn(() => @"{0}{1} can upgrade {2}/{3} package(s). {4}{0} See the log for details ({5}).".format_with(
Environment.NewLine,
ApplicationParameters.Name,
noopUpgrades.Count(p => p.Value.Success && !p.Value.Inconclusive),
noopUpgrades.Count,
upgradeWarnings == 0 ? string.Empty : "{0} {1} package(s) had warnings.".format_with(Environment.NewLine, upgradeWarnings)));
upgradeWarnings == 0 ? string.Empty : "{0} {1} package(s) had warnings.".format_with(Environment.NewLine, upgradeWarnings),
_fileSystem.combine_paths(ApplicationParameters.LoggingLocation, ApplicationParameters.LoggingFile)
));

if (upgradeWarnings != 0)
{
Expand Down Expand Up @@ -371,13 +375,15 @@ public ConcurrentDictionary<string, PackageResult> upgrade_run(ChocolateyConfigu

var upgradeFailures = packageUpgrades.Count(p => !p.Value.Success);
var upgradeWarnings = packageUpgrades.Count(p => p.Value.Warning);
this.Log().Warn(() => @"{0}{1} upgraded {2}/{3} package(s). {4} package(s) failed.{5}{0} See the log for details.".format_with(
this.Log().Warn(() => @"{0}{1} upgraded {2}/{3} package(s). {4} package(s) failed.{5}{0} See the log for details ({6}).".format_with(
Environment.NewLine,
ApplicationParameters.Name,
packageUpgrades.Count(p => p.Value.Success && !p.Value.Inconclusive),
packageUpgrades.Count,
upgradeFailures,
upgradeWarnings == 0 ? string.Empty : "{0} {1} package(s) had warnings.".format_with(Environment.NewLine, upgradeWarnings)));
upgradeWarnings == 0 ? string.Empty : "{0} {1} package(s) had warnings.".format_with(Environment.NewLine, upgradeWarnings),
_fileSystem.combine_paths(ApplicationParameters.LoggingLocation, ApplicationParameters.LoggingFile)
));

if (upgradeWarnings != 0)
{
Expand Down Expand Up @@ -453,12 +459,14 @@ public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfi
});

var uninstallFailures = packageUninstalls.Count(p => !p.Value.Success);
this.Log().Warn(() => @"{0}{1} uninstalled {2}/{3} packages. {4} packages failed.{0}See the log for details.".format_with(
this.Log().Warn(() => @"{0}{1} uninstalled {2}/{3} packages. {4} packages failed.{0} See the log for details ({5}).".format_with(
Environment.NewLine,
ApplicationParameters.Name,
packageUninstalls.Count(p => p.Value.Success && !p.Value.Inconclusive),
packageUninstalls.Count,
uninstallFailures));
uninstallFailures,
_fileSystem.combine_paths(ApplicationParameters.LoggingLocation, ApplicationParameters.LoggingFile)
));

if (uninstallFailures != 0)
{
Expand Down

0 comments on commit e683783

Please sign in to comment.