aboutsummaryrefslogtreecommitdiff
path: root/internal/route/repo/editor.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/route/repo/editor.go')
-rw-r--r--internal/route/repo/editor.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/route/repo/editor.go b/internal/route/repo/editor.go
index 54f6c20b..75254a2e 100644
--- a/internal/route/repo/editor.go
+++ b/internal/route/repo/editor.go
@@ -11,7 +11,7 @@ import (
"path"
"strings"
- log "gopkg.in/clog.v1"
+ log "unknwon.dev/clog/v2"
"github.com/gogs/git-module"
"gogs.io/gogs/internal/context"
@@ -91,7 +91,7 @@ func editFile(c *context.Context, isNewFile bool) {
buf = append(buf, d...)
if err, content := template.ToUTF8WithErr(buf); err != nil {
if err != nil {
- log.Error(2, "Failed to convert encoding to UTF-8: %v", err)
+ log.Error("Failed to convert encoding to UTF-8: %v", err)
}
c.Data["FileContent"] = string(buf)
} else {
@@ -278,7 +278,7 @@ func editFilePost(c *context.Context, f form.EditRepoFile, isNewFile bool) {
Content: strings.Replace(f.Content, "\r", "", -1),
IsNewFile: isNewFile,
}); err != nil {
- log.Error(2, "Failed to update repo file: %v", err)
+ log.Error("Failed to update repo file: %v", err)
c.FormErr("TreePath")
c.RenderWithErr(c.Tr("repo.editor.fail_to_update_file", f.TreePath, errors.InternalServerError), EDIT_FILE, &f)
return
@@ -385,7 +385,7 @@ func DeleteFilePost(c *context.Context, f form.DeleteRepoFile) {
TreePath: c.Repo.TreePath,
Message: message,
}); err != nil {
- log.Error(2, "Failed to delete repo file: %v", err)
+ log.Error("Failed to delete repo file: %v", err)
c.RenderWithErr(c.Tr("repo.editor.fail_to_delete_file", c.Repo.TreePath, errors.InternalServerError), DELETE_FILE, &f)
return
}
@@ -505,7 +505,7 @@ func UploadFilePost(c *context.Context, f form.UploadRepoFile) {
Message: message,
Files: f.Files,
}); err != nil {
- log.Error(2, "Failed to upload files: %v", err)
+ log.Error("Failed to upload files: %v", err)
c.FormErr("TreePath")
c.RenderWithErr(c.Tr("repo.editor.unable_to_upload_files", f.TreePath, errors.InternalServerError), UPLOAD_FILE, &f)
return