1
0

feat: update tool logs to be more coherent

This commit is contained in:
2026-03-11 13:56:00 +01:00
parent 35c8840ed4
commit 46d32c43ba
5 changed files with 21 additions and 22 deletions

View File

@@ -70,9 +70,8 @@ internal static partial class EditTools
{
newLines = SanitizeNewLines(newLines);
path = FileTools.ResolvePath(path);
Log($"REPLACE_LINES: {path}");
Log($" Range: {startAnchor} -> {endAnchor}");
Log($" Replacing {endAnchor.Split(':')[0]}-{startAnchor.Split(':')[0]} lines with {newLines.Length} new lines");
Log($" ● replace_lines: {path}");
Log($" {startAnchor.Split(':')[0]}-{endAnchor.Split(':')[0]} lines -> {newLines.Length} new lines");
if (!File.Exists(path))
return $"ERROR: File not found: {path}\n Check the correct path and try again.";
@@ -107,7 +106,8 @@ internal static partial class EditTools
[Description("Last line's line:hash anchor (e.g. '6:19').")] string endAnchor)
{
path = FileTools.ResolvePath(path);
Log($"Deleting lines in file: {path}");
Log($" ● delete_range: {path}");
Log($" {startAnchor.Split(':')[0]}-{endAnchor.Split(':')[0]} lines");
if (!File.Exists(path))
return $"ERROR: File not found: {path}";
@@ -142,7 +142,7 @@ internal static partial class EditTools
{
path = FileTools.ResolvePath(path);
string targetType = mode.Equals("dir", StringComparison.CurrentCultureIgnoreCase) ? "directory" : "file";
Log($"Deleting {targetType}: {path}");
Log($" ● delete_{targetType}: {path}");
if (mode.Equals("dir", StringComparison.CurrentCultureIgnoreCase))
{
@@ -184,8 +184,8 @@ internal static partial class EditTools
{
sourcePath = FileTools.ResolvePath(sourcePath);
destinationPath = FileTools.ResolvePath(destinationPath);
string action = copy ? "Copying" : "Moving";
Log($"{action} file: {sourcePath} -> {destinationPath}");
string action = copy ? "copy" : "move";
Log($"{action}_file: {sourcePath} -> {destinationPath}");
if (!File.Exists(sourcePath))
return $"ERROR: Source file not found: {sourcePath}";
@@ -221,9 +221,8 @@ internal static partial class EditTools
{
content = SanitizeNewLines(content);
path = FileTools.ResolvePath(path);
Log($"WRITE_TO_FILE: {path}");
Log($" Mode: {mode}");
Log($" Writing {content.Length} lines");
Log($" ● write_to_file: {path}");
Log($" mode: {mode} with {content.Length} lines");
try
{
@@ -298,8 +297,8 @@ internal static partial class EditTools
[Description("Array of operations to apply. Operations are applied in bottom-to-top order automatically.")] BatchOperation[] operations)
{
path = FileTools.ResolvePath(path);
Log($"BATCH_EDIT: {path}");
Log($" Operations: {operations.Length}");
Log($" ● batch_edit: {path}");
Log($" operations: {operations.Length}");
if (!File.Exists(path))
return $"ERROR: File not found: {path}";