Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Fixing the logging of CopyHelper #983

Merged
merged 3 commits into from
Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/GitHub.Api/Installer/CopyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class CopyHelper

public static void Copy(NPath fromPath, NPath toPath)
{
Logger.Trace("Copying from " + fromPath + " to " + toPath + ".");
Logger.Trace("Copying from {0} to {1}", fromPath, toPath);

try
{
Expand All @@ -28,7 +28,7 @@ public static void Copy(NPath fromPath, NPath toPath)
}
catch (Exception ex2)
{
Logger.Error(ex1, "Error copying contents.");
Logger.Error(ex2, "Error copying contents.");
throw;
}
}
Expand All @@ -39,15 +39,15 @@ public static void Copy(NPath fromPath, NPath toPath)
}
public static void CopyFolder(NPath fromPath, NPath toPath)
{
Logger.Trace("CopyFolder fromPath: {0} toPath:{1}", fromPath.ToString(), toPath.ToString());
Logger.Trace("CopyFolder from {0} to {1}", fromPath, toPath);
toPath.DeleteIfExists();
toPath.EnsureParentDirectoryExists();
fromPath.Move(toPath);
}

public static void CopyFolderContents(NPath fromPath, NPath toPath)
{
Logger.Trace("CopyFolder Contents fromPath: {0} toPath:{1}", fromPath.ToString(), toPath.ToString());
Logger.Trace("CopyFolderContents from {0} to {1}", fromPath, toPath);
toPath.DeleteContents();
fromPath.MoveFiles(toPath, true);
}
Expand Down