Skip to content

Commit

Permalink
(GH-557) Adjust logging of upgrade messages
Browse files Browse the repository at this point in the history
Upgrade messages should not look like they belong with the prior
package. Add a space before the message when logging to separate them
out.
  • Loading branch information
ferventcoder committed Jun 11, 2016
1 parent bfa6b1f commit 7875987
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,21 +592,21 @@ public void remove_rollback_directory_if_exists(string packageName)
IPackage availablePackage = packageManager.SourceRepository.FindPackage(packageName, version, config.Prerelease, allowUnlisted: false);
if (availablePackage == null)
{
string logMessage = "{0} was not found with the source(s) listed.{1} If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.{1} Version: \"{2}\"{1} Source(s): \"{3}\"".format_with(packageName, Environment.NewLine, config.Version, config.Sources);
string logMessage = "{0} was not found with the source(s) listed.{1} If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.{1} Version: \"{2}\"; Source(s): \"{3}\"".format_with(packageName, Environment.NewLine, config.Version, config.Sources);
var unfoundResult = packageInstalls.GetOrAdd(packageName, new PackageResult(packageName, version.to_string(), null));

if (config.UpgradeCommand.FailOnUnfound)
{
unfoundResult.Messages.Add(new ResultMessage(ResultType.Error, logMessage));
if (config.RegularOutput) this.Log().Error(ChocolateyLoggers.Important, logMessage);
if (config.RegularOutput) this.Log().Error(ChocolateyLoggers.Important, "{0}{1}".format_with(Environment.NewLine, logMessage));
}
else
{
unfoundResult.Messages.Add(new ResultMessage(ResultType.Warn, logMessage));
unfoundResult.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage));
if (config.RegularOutput)
{
this.Log().Warn(ChocolateyLoggers.Important, logMessage);
this.Log().Warn(ChocolateyLoggers.Important, "{0}{1}".format_with(Environment.NewLine, logMessage));
}
else
{
Expand Down Expand Up @@ -634,7 +634,7 @@ public void remove_rollback_directory_if_exists(string packageName)
{
if (config.RegularOutput)
{
this.Log().Info(ChocolateyLoggers.Important, logMessage);
this.Log().Info(ChocolateyLoggers.Important, "{0}{1}".format_with(Environment.NewLine, logMessage));
}
else
{
Expand All @@ -660,7 +660,7 @@ public void remove_rollback_directory_if_exists(string packageName)
{
if (config.RegularOutput)
{
this.Log().Info(logMessage);
this.Log().Info("{0}{1}".format_with(Environment.NewLine, logMessage));
}
else
{
Expand All @@ -684,7 +684,7 @@ public void remove_rollback_directory_if_exists(string packageName)

if (config.RegularOutput)
{
this.Log().Warn(logMessage);
this.Log().Warn("{0}{1}".format_with(Environment.NewLine, logMessage));
}
else
{
Expand Down

0 comments on commit 7875987

Please sign in to comment.