From 1fe7f14d578bf7bc015a24402b96a744ac5555f8 Mon Sep 17 00:00:00 2001 From: wozulong <> Date: Sun, 28 Apr 2024 14:04:39 +0800 Subject: [PATCH] merge upstream Signed-off-by: wozulong <> --- common/logger.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/common/logger.go b/common/logger.go index a91c915..ac03bd1 100644 --- a/common/logger.go +++ b/common/logger.go @@ -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))) -}