merge upstream

Signed-off-by: wozulong <>
This commit is contained in:
wozulong
2024-04-28 14:04:39 +08:00
parent a7bafec1bf
commit 1fe7f14d57

View File

@@ -2,7 +2,6 @@ package common
import (
"context"
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"io"
@@ -100,7 +99,6 @@ func LogQuota(quota int) string {
}
}
func LogQuotaF(quota float64) string {
if DisplayInCurrencyEnabled {
return fmt.Sprintf("%.6f 额度", quota/QuotaPerUnit)
@@ -108,14 +106,3 @@ func LogQuotaF(quota float64) string {
return fmt.Sprintf("%d 点额度", int64(quota))
}
}
// LogJson 仅供测试使用 only for test
func LogJson(ctx context.Context, msg string, obj any) {
jsonStr, err := json.Marshal(obj)
if err != nil {
LogError(ctx, fmt.Sprintf("json marshal failed: %s", err.Error()))
return
}
LogInfo(ctx, fmt.Sprintf("%s | %s", msg, string(jsonStr)))
}