mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-11 16:43:41 +08:00
merge upstream
Signed-off-by: wozulong <>
This commit is contained in:
@@ -2,7 +2,6 @@ package common
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"io"
|
"io"
|
||||||
@@ -100,7 +99,6 @@ func LogQuota(quota int) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func LogQuotaF(quota float64) string {
|
func LogQuotaF(quota float64) string {
|
||||||
if DisplayInCurrencyEnabled {
|
if DisplayInCurrencyEnabled {
|
||||||
return fmt.Sprintf("$%.6f 额度", quota/QuotaPerUnit)
|
return fmt.Sprintf("$%.6f 额度", quota/QuotaPerUnit)
|
||||||
@@ -108,14 +106,3 @@ func LogQuotaF(quota float64) string {
|
|||||||
return fmt.Sprintf("%d 点额度", int64(quota))
|
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)))
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user