Skip to content

Commit

Permalink
(GH-4) move most logging items to verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Dec 22, 2017
1 parent 9822108 commit 7644eab
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/CommandLine.ServerExtensions/PackageMirrorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ private int Execute(IPackage package, IPackageOperationResolver resolver)
{
if (TargetRepository.Exists(package))
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageAlreadyPresent, p.GetFullName(), TargetRepository.Source);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_PackageAlreadyPresent, p.GetFullName(), TargetRepository.Source);
}
else
{
ExecuteMirror(p);
countMirrored++;
Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageMirroredSuccessfully, p.GetFullName(), TargetRepository.Source);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_PackageMirroredSuccessfully, p.GetFullName(), TargetRepository.Source);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/CommandLine.ServerExtensions/PackageServerRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ public IQueryable<IPackage> GetPackages()

public void AddPackage(IPackage package)
{
_logger.Log(MessageLevel.Info, NuGetResources.MirrorCommandPushingPackage, package.GetFullName(), CommandLineUtility.GetSourceDisplayName(_destination.Source));
_logger.Log(MessageLevel.Verbose, NuGetResources.MirrorCommandPushingPackage, package.GetFullName(), CommandLineUtility.GetSourceDisplayName(_destination.Source));
_destination.PushPackage(
_apiKey,
package,
package.GetStream().Length,
(int)_timeout.TotalMilliseconds,
disableBuffering: false);
_logger.Log(MessageLevel.Info, NuGetResources.MirrorCommandPackagePushed);
_logger.Log(MessageLevel.Verbose, NuGetResources.MirrorCommandPackagePushed);
}

public void RemovePackage(IPackage package)
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/Commands/ProjectFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public PackageBuilder CreateBuilder(string basePath)
{
BuildProject();

Logger.Log(MessageLevel.Info, LocalizedResourceManager.GetString("PackagingFilesFromOutputPath"), Path.GetDirectoryName(TargetPath));
Logger.Log(MessageLevel.Verbose, LocalizedResourceManager.GetString("PackagingFilesFromOutputPath"), Path.GetDirectoryName(TargetPath));

var builder = new PackageBuilder();

Expand Down
14 changes: 7 additions & 7 deletions src/Core/PackageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private void Execute(IPackage package, IPackageOperationResolver resolver)
else if (LocalRepository.Exists(package))
{
// If the package wasn't installed by our set of operations, notify the user.
Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageAlreadyInstalled, package.GetFullName());
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_PackageAlreadyInstalled, package.GetFullName());
}
}

Expand All @@ -185,7 +185,7 @@ protected void Execute(PackageOperation operation)
// If the package is already installed, then skip it
if (packageExists)
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageAlreadyInstalled, operation.Package.GetFullName());
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_PackageAlreadyInstalled, operation.Package.GetFullName());
}
else
{
Expand Down Expand Up @@ -218,7 +218,7 @@ protected void Execute(PackageOperation operation)
protected void ExecuteInstall(IPackage package)
{
string packageFullName = package.GetFullName();
Logger.Log(MessageLevel.Info, NuGetResources.Log_BeginInstallPackage, packageFullName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_BeginInstallPackage, packageFullName);

PackageOperationEventArgs args = CreateOperation(package);
OnInstalling(args);
Expand All @@ -232,7 +232,7 @@ protected void ExecuteInstall(IPackage package)

LocalRepository.AddPackage(package);

Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageInstalledSuccessfully, packageFullName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_PackageInstalledSuccessfully, packageFullName);

OnInstalled(args);
}
Expand Down Expand Up @@ -338,7 +338,7 @@ public virtual void UninstallPackage(IPackage package, bool forceRemove, bool re
protected virtual void ExecuteUninstall(IPackage package)
{
string packageFullName = package.GetFullName();
Logger.Log(MessageLevel.Info, NuGetResources.Log_BeginUninstallPackage, packageFullName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_BeginUninstallPackage, packageFullName);

PackageOperationEventArgs args = CreateOperation(package);
OnUninstalling(args);
Expand All @@ -352,7 +352,7 @@ protected virtual void ExecuteUninstall(IPackage package)

LocalRepository.RemovePackage(package);

Logger.Log(MessageLevel.Info, NuGetResources.Log_SuccessfullyUninstalledPackage, packageFullName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_SuccessfullyUninstalledPackage, packageFullName);

OnUninstalled(args);
}
Expand Down Expand Up @@ -467,7 +467,7 @@ internal void UpdatePackage(string packageId, Func<IPackage> resolvePackage, boo
}
else
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_NoUpdatesAvailable, packageId);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_NoUpdatesAvailable, packageId);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/PackageWalker/InstallWalker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ protected override void OnAfterPackageWalk(IPackage package)

protected override IPackage ResolveDependency(PackageDependency dependency)
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_AttemptingToRetrievePackageFromSource, dependency);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_AttemptingToRetrievePackageFromSource, dependency);

// First try to get a local copy of the package
// Bug1638: Include prereleases when resolving locally installed dependencies.
Expand Down
20 changes: 10 additions & 10 deletions src/Core/ProjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private void Execute(IPackage package, IPackageOperationResolver resolver)
}
else if (LocalRepository.Exists(package))
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_ProjectAlreadyReferencesPackage, Project.ProjectName, package.GetFullName());
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_ProjectAlreadyReferencesPackage, Project.ProjectName, package.GetFullName());
}
}

Expand All @@ -188,7 +188,7 @@ protected void Execute(PackageOperation operation)
// If the package is already installed, then skip it
if (packageExists)
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_ProjectAlreadyReferencesPackage, Project.ProjectName, operation.Package.GetFullName());
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_ProjectAlreadyReferencesPackage, Project.ProjectName, operation.Package.GetFullName());
}
else
{
Expand Down Expand Up @@ -235,7 +235,7 @@ protected void Execute(PackageOperation operation)
protected void AddPackageReferenceToProject(IPackage package)
{
string packageFullName = package.GetFullName();
Logger.Log(MessageLevel.Info, NuGetResources.Log_BeginAddPackageReference, packageFullName, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_BeginAddPackageReference, packageFullName, Project.ProjectName);

PackageOperationEventArgs args = CreateOperation(package);
OnPackageReferenceAdding(args);
Expand All @@ -247,7 +247,7 @@ protected void AddPackageReferenceToProject(IPackage package)

ExtractPackageFilesToProject(package);

Logger.Log(MessageLevel.Info, NuGetResources.Log_SuccessfullyAddedPackageReference, packageFullName, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_SuccessfullyAddedPackageReference, packageFullName, Project.ProjectName);
OnPackageReferenceAdded(args);
}

Expand Down Expand Up @@ -437,7 +437,7 @@ public virtual void RemovePackageReference(IPackage package, bool forceRemove, b
private void RemovePackageReferenceFromProject(IPackage package)
{
string packageFullName = package.GetFullName();
Logger.Log(MessageLevel.Info, NuGetResources.Log_BeginRemovePackageReference, packageFullName, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_BeginRemovePackageReference, packageFullName, Project.ProjectName);

PackageOperationEventArgs args = CreateOperation(package);
OnPackageReferenceRemoving(args);
Expand Down Expand Up @@ -495,7 +495,7 @@ from file in GetCompatibleInstalledItemsForPackage(p.Id, p.GetContentFiles())
LocalRepository.RemovePackage(package);


Logger.Log(MessageLevel.Info, NuGetResources.Log_SuccessfullyRemovedPackageReference, packageFullName, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_SuccessfullyRemovedPackageReference, packageFullName, Project.ProjectName);
OnPackageReferenceRemoved(args);
}

Expand Down Expand Up @@ -589,24 +589,24 @@ private void UpdatePackageReference(string packageId, Func<IPackage> resolvePack
oldPackage.Version != package.Version &&
(allowPrereleaseVersions || targetVersionSetExplicitly || oldPackage.IsReleaseVersion() || !package.IsReleaseVersion() || oldPackage.Version < package.Version))
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_UpdatingPackages, package.Id, oldPackage.Version, package.Version, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_UpdatingPackages, package.Id, oldPackage.Version, package.Version, Project.ProjectName);
UpdatePackageReferenceCore(package, updateDependencies, allowPrereleaseVersions);
}
else
{
IVersionSpec constraint = ConstraintProvider.GetConstraint(packageId);
if (constraint != null)
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_ApplyingConstraints, packageId, VersionUtility.PrettyPrint(constraint), ConstraintProvider.Source);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_ApplyingConstraints, packageId, VersionUtility.PrettyPrint(constraint), ConstraintProvider.Source);
}

Logger.Log(MessageLevel.Info, NuGetResources.Log_NoUpdatesAvailableForProject, packageId, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_NoUpdatesAvailableForProject, packageId, Project.ProjectName);
}
}

public virtual void UpdatePackageReference(IPackage remotePackage, bool updateDependencies, bool allowPrereleaseVersions)
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_UpdatingPackagesWithoutOldVersion, remotePackage.Id, remotePackage.Version, Project.ProjectName);
Logger.Log(MessageLevel.Verbose, NuGetResources.Log_UpdatingPackagesWithoutOldVersion, remotePackage.Id, remotePackage.Version, Project.ProjectName);
UpdatePackageReferenceCore(remotePackage, updateDependencies, allowPrereleaseVersions);
}

Expand Down

0 comments on commit 7644eab

Please sign in to comment.