mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-16 21:23:44 +08:00
🔖 chore: migration logger package
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"one-api/common"
|
||||
"one-api/common/logger"
|
||||
"one-api/common/requester"
|
||||
"one-api/model"
|
||||
"one-api/providers/base"
|
||||
@@ -71,7 +72,7 @@ func (p *MidjourneyProvider) Send(timeout int, requestURL string) (*MidjourneyRe
|
||||
|
||||
resp, errWith := p.Requester.SendRequestRaw(req)
|
||||
if errWith != nil {
|
||||
common.SysError("do request failed: " + errWith.Error())
|
||||
logger.SysError("do request failed: " + errWith.Error())
|
||||
return MidjourneyErrorWithStatusCodeWrapper(MjErrorUnknown, "do_request_failed", http.StatusInternalServerError), nullBytes, err
|
||||
}
|
||||
statusCode := resp.StatusCode
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"one-api/common"
|
||||
"one-api/common/logger"
|
||||
"one-api/common/requester"
|
||||
"one-api/model"
|
||||
"one-api/providers/base"
|
||||
@@ -94,7 +94,7 @@ func (p *XunfeiProvider) getAPIVersion(modelName string) string {
|
||||
}
|
||||
apiVersion = "v1.1"
|
||||
|
||||
common.SysLog("api_version not found, use default: " + apiVersion)
|
||||
logger.SysLog("api_version not found, use default: " + apiVersion)
|
||||
return apiVersion
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ func (p *XunfeiProvider) buildXunfeiAuthUrl(hostUrl string, apiKey, apiSecret st
|
||||
}
|
||||
ul, err := url.Parse(hostUrl)
|
||||
if err != nil {
|
||||
common.SysError("url parse error: " + err.Error())
|
||||
logger.SysError("url parse error: " + err.Error())
|
||||
return ""
|
||||
}
|
||||
date := time.Now().UTC().Format(time.RFC1123)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"one-api/common"
|
||||
"one-api/common/logger"
|
||||
"one-api/common/requester"
|
||||
"one-api/model"
|
||||
"one-api/providers/base"
|
||||
@@ -95,7 +95,7 @@ func (p *ZhipuProvider) getZhipuToken() string {
|
||||
|
||||
split := strings.Split(apikey, ".")
|
||||
if len(split) != 2 {
|
||||
common.SysError("invalid zhipu key: " + apikey)
|
||||
logger.SysError("invalid zhipu key: " + apikey)
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user