本文整理汇总了Golang中github.com/astaxie/beego/logs.BeeLogger.Debug方法的典型用法代码示例。如果您正苦于以下问题:Golang BeeLogger.Debug方法的具体用法?Golang BeeLogger.Debug怎么用?Golang BeeLogger.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/astaxie/beego/logs.BeeLogger
的用法示例。
在下文中一共展示了BeeLogger.Debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: PutImageChecksumV1Handler
func PutImageChecksumV1Handler(ctx *macaron.Context, log *logs.BeeLogger) (int, []byte) {
imageId := ctx.Params(":imageId")
checksum := strings.Split(ctx.Req.Header.Get("X-Docker-Checksum"), ":")[1]
payload := strings.Split(ctx.Req.Header.Get("X-Docker-Checksum-Payload"), ":")[1]
log.Debug("[REGISTRY API V1] Image Checksum : %v", checksum)
log.Debug("[REGISTRY API V1] Image Payload: %v", payload)
i := new(models.Image)
if err := i.PutChecksum(imageId, checksum, true, payload); err != nil {
log.Error("[REGISTRY API V1] Put Image Checksum & Payload Error: %v", err.Error())
result, _ := json.Marshal(map[string]string{"message": "Put Image Checksum & Payload Error"})
return http.StatusBadRequest, result
}
if err := i.PutAncestry(imageId); err != nil {
log.Error("[REGISTRY API V1] Put Image Ancestry Error: %v", err.Error())
result, _ := json.Marshal(map[string]string{"message": "Put Image Ancestry Error"})
return http.StatusBadRequest, result
}
result, _ := json.Marshal(map[string]string{})
return http.StatusOK, result
}
示例2: DownloadFile
func DownloadFile(ctx *macaron.Context, log *logs.BeeLogger) (int, []byte) {
header := ctx.Req.Header
path := header.Get(headerPath)
fragmentIndex := header.Get(headerIndex)
bytesRange := header.Get(headerRange)
start, end, err := splitRange(bytesRange)
if err != nil {
log.Error("[OSS]splitRange error, bytesRange: %s, error: %s", bytesRange, err)
return http.StatusBadRequest, []byte(err.Error())
}
index, err := strconv.ParseUint(fragmentIndex, 10, 64)
if err != nil {
log.Error("[OSS]parser fragmentIndex: %s, error: %s", fragmentIndex, err)
return http.StatusBadRequest, []byte(err.Error())
}
log.Info("[OSS]path: %s, fragmentIndex: %d, bytesRange: %d-%d", path, index, start, end)
metaInfoValue := &meta.MetaInfoValue{
Index: index,
Start: start,
End: end,
}
metaInfo := &meta.MetaInfo{Path: path, Value: metaInfoValue}
log.Debug("[OSS]metaInfo: %s", metaInfo)
chunkServer, err := getOneNormalChunkServer(metaInfo)
if err != nil {
if err.Error() == "fragment metainfo not found" {
return http.StatusNotFound, []byte(err.Error())
} else {
return http.StatusInternalServerError, []byte(err.Error())
}
}
connPools := GetConnectionPools()
conn, err := connPools.GetConn(chunkServer)
log.Info("downloadFile getconnection success")
if err != nil {
log.Error("downloadFile getconnection error: %v", err)
return http.StatusInternalServerError, []byte(err.Error())
}
data, err := chunkServer.GetData(metaInfo.Value, conn.(*chunkserver.PooledConn))
if err != nil {
conn.Close()
connPools.ReleaseConn(conn)
checkErrorAndConnPool(err, chunkServer, connPools)
return http.StatusInternalServerError, []byte(err.Error())
}
log.Info("[OSS][downloadFile] success. path: %s, fragmentIndex: %d, bytesRange: %d-%d", path, index, start, end)
connPools.ReleaseConn(conn)
return http.StatusOK, data
}
示例3: PutTagV1Handler
func PutTagV1Handler(ctx *macaron.Context, log *logs.BeeLogger) (int, []byte) {
namespace := ctx.Params(":namespace")
repository := ctx.Params(":repository")
tag := ctx.Params(":tag")
bodystr, _ := ctx.Req.Body().String()
log.Debug("[REGISTRY API V1] Repository Tag : %v", bodystr)
r, _ := regexp.Compile(`"([[:alnum:]]+)"`)
imageIds := r.FindStringSubmatch(bodystr)
repo := new(models.Repository)
if err := repo.PutTag(imageIds[1], namespace, repository, tag); err != nil {
log.Error("[REGISTRY API V1] Put repository tag error: %v", err.Error())
result, _ := json.Marshal(map[string]string{"message": err.Error()})
return http.StatusBadRequest, result
}
result, _ := json.Marshal(map[string]string{})
return http.StatusOK, result
}