feat: 日志增强

This commit is contained in:
tbphp committed 2025-07-14 00:18:15 +08:00
1 parent 2740254cf1
commit 807b766e79
6 files changed
+57 -15

No files matched your search

+8
View File
@@ -10,3 +10,11 @@ func MaskAPIKey(key string) string {
}
return fmt.Sprintf("%s****%s", key[:4], key[length-4:])
}
// TruncateString shortens a string to a maximum length.
func TruncateString(s string, maxLength int) string {
if len(s) > maxLength {
return s[:maxLength]
}
return s
}