befly 3.23.0 → 3.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/checks/config.js CHANGED
@@ -25,6 +25,7 @@ const configSchema = z
25
25
  uploadMaxSize: z.int().min(1),
26
26
  tz: z.string().refine((value) => isValidTimeZone(value), "无效的时区"),
27
27
  publicDir: noTrimString.min(1),
28
+ excludeApisLog: z.array(noTrimString),
28
29
 
29
30
  logger: z
30
31
  .object({
@@ -11,6 +11,7 @@
11
11
  "apiHost": "http://127.0.0.1",
12
12
  "publicDir": "./public",
13
13
  "publicHost": "http://127.0.0.1:3000",
14
+ "excludeApisLog": ["/api/core/tongJi/errorReport", "/api/core/tongJi/infoReport", "/api/core/tongJi/onlineReport"],
14
15
  "logger": {
15
16
  "debug": 1,
16
17
  "excludeFields": ["password", "token", "secret"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "befly",
3
- "version": "3.23.0",
4
- "gitHead": "323ac9336929e2beaab435e9865194e22a884c82",
3
+ "version": "3.23.1",
4
+ "gitHead": "b66a96633fc12a6761ee2838d4037f2b619b1588",
5
5
  "private": false,
6
6
  "description": "Befly - 为 Bun 专属打造的 JavaScript API 接口框架核心引擎",
7
7
  "keywords": [
package/router/api.js CHANGED
@@ -106,7 +106,11 @@ export function apiHandler(apis, hooks, context) {
106
106
  logData["body"] = ctx.body;
107
107
  }
108
108
 
109
- Logger.info("请求", logData);
109
+ const shouldSkipRequestLog = context.config.excludeApisLog.includes(ctx.apiPath);
110
+
111
+ if (!shouldSkipRequestLog) {
112
+ Logger.info("请求", logData);
113
+ }
110
114
 
111
115
  // 5. 执行 API handler
112
116
  const result = await ctx.apiHandler(context, ctx);