remove old logs

Kujtim Hoxha created

Change summary

internal/llm/tools/edit.go  | 11 ++++++-----
internal/llm/tools/patch.go |  7 ++++---
internal/llm/tools/write.go |  5 +++--
3 files changed, 13 insertions(+), 10 deletions(-)

Detailed changes

internal/llm/tools/edit.go 🔗

@@ -12,6 +12,7 @@ import (
 	"github.com/kujtimiihoxha/opencode/internal/config"
 	"github.com/kujtimiihoxha/opencode/internal/diff"
 	"github.com/kujtimiihoxha/opencode/internal/history"
+	"github.com/kujtimiihoxha/opencode/internal/logging"
 	"github.com/kujtimiihoxha/opencode/internal/lsp"
 	"github.com/kujtimiihoxha/opencode/internal/permission"
 )
@@ -227,7 +228,7 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
 	_, err = e.files.CreateVersion(ctx, sessionID, filePath, content)
 	if err != nil {
 		// Log error but don't fail the operation
-		fmt.Printf("Error creating file history version: %v\n", err)
+		logging.Debug("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)
@@ -334,13 +335,13 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
 		// User Manually changed the content store an intermediate version
 		_, err = e.files.CreateVersion(ctx, sessionID, filePath, oldContent)
 		if err != nil {
-			fmt.Printf("Error creating file history version: %v\n", err)
+			logging.Debug("Error creating file history version", "error", err)
 		}
 	}
 	// Store the new version
 	_, err = e.files.CreateVersion(ctx, sessionID, filePath, "")
 	if err != nil {
-		fmt.Printf("Error creating file history version: %v\n", err)
+		logging.Debug("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)
@@ -448,13 +449,13 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
 		// User Manually changed the content store an intermediate version
 		_, err = e.files.CreateVersion(ctx, sessionID, filePath, oldContent)
 		if err != nil {
-			fmt.Printf("Error creating file history version: %v\n", err)
+			logging.Debug("Error creating file history version", "error", err)
 		}
 	}
 	// Store the new version
 	_, err = e.files.CreateVersion(ctx, sessionID, filePath, newContent)
 	if err != nil {
-		fmt.Printf("Error creating file history version: %v\n", err)
+		logging.Debug("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)

internal/llm/tools/patch.go 🔗

@@ -11,6 +11,7 @@ import (
 	"github.com/kujtimiihoxha/opencode/internal/config"
 	"github.com/kujtimiihoxha/opencode/internal/diff"
 	"github.com/kujtimiihoxha/opencode/internal/history"
+	"github.com/kujtimiihoxha/opencode/internal/logging"
 	"github.com/kujtimiihoxha/opencode/internal/lsp"
 	"github.com/kujtimiihoxha/opencode/internal/permission"
 )
@@ -314,7 +315,7 @@ func (p *patchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
 			// If not adding a file, create history entry for existing file
 			_, err = p.files.Create(ctx, sessionID, absPath, oldContent)
 			if err != nil {
-				fmt.Printf("Error creating file history: %v\n", err)
+				logging.Debug("Error creating file history", "error", err)
 			}
 		}
 
@@ -322,7 +323,7 @@ func (p *patchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
 			// User manually changed content, store intermediate version
 			_, err = p.files.CreateVersion(ctx, sessionID, absPath, oldContent)
 			if err != nil {
-				fmt.Printf("Error creating file history version: %v\n", err)
+				logging.Debug("Error creating file history version", "error", err)
 			}
 		}
 
@@ -333,7 +334,7 @@ func (p *patchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
 			_, err = p.files.CreateVersion(ctx, sessionID, absPath, newContent)
 		}
 		if err != nil {
-			fmt.Printf("Error creating file history version: %v\n", err)
+			logging.Debug("Error creating file history version", "error", err)
 		}
 
 		// Record file operations

internal/llm/tools/write.go 🔗

@@ -11,6 +11,7 @@ import (
 	"github.com/kujtimiihoxha/opencode/internal/config"
 	"github.com/kujtimiihoxha/opencode/internal/diff"
 	"github.com/kujtimiihoxha/opencode/internal/history"
+	"github.com/kujtimiihoxha/opencode/internal/logging"
 	"github.com/kujtimiihoxha/opencode/internal/lsp"
 	"github.com/kujtimiihoxha/opencode/internal/permission"
 )
@@ -192,13 +193,13 @@ func (w *writeTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
 		// User Manually changed the content store an intermediate version
 		_, err = w.files.CreateVersion(ctx, sessionID, filePath, oldContent)
 		if err != nil {
-			fmt.Printf("Error creating file history version: %v\n", err)
+			logging.Debug("Error creating file history version", "error", err)
 		}
 	}
 	// Store the new version
 	_, err = w.files.CreateVersion(ctx, sessionID, filePath, params.Content)
 	if err != nil {
-		fmt.Printf("Error creating file history version: %v\n", err)
+		logging.Debug("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)