mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 15:50:00 +01:00
log: migrate to unknwon.dev/clog/v2 (#5927)
* Add unknwon.dev/clog/v2 * Update all places
This commit is contained in:
@@ -6,11 +6,10 @@ package repo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
convert2 "gogs.io/gogs/internal/route/api/v1/convert"
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
log "gopkg.in/clog.v1"
|
||||
log "unknwon.dev/clog/v2"
|
||||
|
||||
api "github.com/gogs/go-gogs-client"
|
||||
|
||||
@@ -18,6 +17,7 @@ import (
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/db/errors"
|
||||
"gogs.io/gogs/internal/form"
|
||||
"gogs.io/gogs/internal/route/api/v1/convert"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ func Search(c *context.APIContext) {
|
||||
opts := &db.SearchRepoOptions{
|
||||
Keyword: path.Base(c.Query("q")),
|
||||
OwnerID: c.QueryInt64("uid"),
|
||||
PageSize: convert2.ToCorrectPageSize(c.QueryInt("limit")),
|
||||
PageSize: convert.ToCorrectPageSize(c.QueryInt("limit")),
|
||||
Page: c.QueryInt("page"),
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ func CreateUserRepo(c *context.APIContext, owner *db.User, opt api.CreateRepoOpt
|
||||
} else {
|
||||
if repo != nil {
|
||||
if err = db.DeleteRepository(c.User.ID, repo.ID); err != nil {
|
||||
log.Error(2, "DeleteRepository: %v", err)
|
||||
log.Error("DeleteRepository: %v", err)
|
||||
}
|
||||
}
|
||||
c.ServerError("CreateRepository", err)
|
||||
@@ -270,7 +270,7 @@ func Migrate(c *context.APIContext, f form.MigrateRepo) {
|
||||
if err != nil {
|
||||
if repo != nil {
|
||||
if errDelete := db.DeleteRepository(ctxUser.ID, repo.ID); errDelete != nil {
|
||||
log.Error(2, "DeleteRepository: %v", errDelete)
|
||||
log.Error("DeleteRepository: %v", errDelete)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user