@lark-apaas/client-toolkit 1.1.9-alpha.log.2 → 1.1.9-alpha.log.4
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.
|
@@ -10,7 +10,9 @@ const RenderError = (props)=>{
|
|
|
10
10
|
'Render Error',
|
|
11
11
|
error
|
|
12
12
|
],
|
|
13
|
-
meta: {
|
|
13
|
+
meta: {
|
|
14
|
+
type: 'render-error'
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
}, [
|
|
16
18
|
props.error
|
|
@@ -27,7 +29,7 @@ const RenderError = (props)=>{
|
|
|
27
29
|
}),
|
|
28
30
|
/*#__PURE__*/ jsx("p", {
|
|
29
31
|
className: "text-l/[22px] text-[14px] text-[#1F2329] font-medium",
|
|
30
|
-
children: "
|
|
32
|
+
children: "页面出错了"
|
|
31
33
|
})
|
|
32
34
|
]
|
|
33
35
|
})
|
|
@@ -11,9 +11,10 @@ const NotFound = ()=>{
|
|
|
11
11
|
`页面 ${location.pathname} 不存在`
|
|
12
12
|
],
|
|
13
13
|
meta: {
|
|
14
|
-
repairMessage: `页面 ${location.pathname}
|
|
14
|
+
repairMessage: `页面 ${location.pathname} 不存在,帮我创建对应页面,并配置到"client/src/app.tsx"路由表中`,
|
|
15
15
|
noStacktrace: true,
|
|
16
|
-
stacktrace: []
|
|
16
|
+
stacktrace: [],
|
|
17
|
+
type: 'not-found'
|
|
17
18
|
}
|
|
18
19
|
});
|
|
19
20
|
}, [
|
|
@@ -44,6 +44,7 @@ export declare const logMeta: z.ZodObject<{
|
|
|
44
44
|
skipFrame: z.ZodOptional<z.ZodNumber>;
|
|
45
45
|
noStacktrace: z.ZodOptional<z.ZodBoolean>;
|
|
46
46
|
repairMessage: z.ZodOptional<z.ZodString>;
|
|
47
|
+
type: z.ZodOptional<z.ZodString>;
|
|
47
48
|
}, z.core.$strip>;
|
|
48
49
|
export declare const selectedLogSchema: z.ZodObject<{
|
|
49
50
|
type: z.ZodLiteral<"typedLogV2">;
|
|
@@ -67,6 +68,7 @@ export declare const selectedLogSchema: z.ZodObject<{
|
|
|
67
68
|
skipFrame: z.ZodOptional<z.ZodNumber>;
|
|
68
69
|
noStacktrace: z.ZodOptional<z.ZodBoolean>;
|
|
69
70
|
repairMessage: z.ZodOptional<z.ZodString>;
|
|
71
|
+
type: z.ZodOptional<z.ZodString>;
|
|
70
72
|
}, z.core.$strip>;
|
|
71
73
|
}, z.core.$strip>;
|
|
72
74
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'success';
|
|
@@ -90,6 +92,7 @@ export declare const logWithMetaSchema: z.ZodObject<{
|
|
|
90
92
|
skipFrame: z.ZodOptional<z.ZodNumber>;
|
|
91
93
|
noStacktrace: z.ZodOptional<z.ZodBoolean>;
|
|
92
94
|
repairMessage: z.ZodOptional<z.ZodString>;
|
|
95
|
+
type: z.ZodOptional<z.ZodString>;
|
|
93
96
|
}, z.core.$strip>>;
|
|
94
97
|
}, z.core.$strip>;
|
|
95
98
|
export type LogStackFrame = z.infer<typeof logStackFrameSchema>;
|
package/lib/logger/log-types.js
CHANGED
|
@@ -38,7 +38,8 @@ const logMeta = zod.object({
|
|
|
38
38
|
logTraceID: zod.optional(zod.string()),
|
|
39
39
|
skipFrame: zod.optional(zod.number()),
|
|
40
40
|
noStacktrace: zod.optional(zod.boolean()),
|
|
41
|
-
repairMessage: zod.optional(zod.string())
|
|
41
|
+
repairMessage: zod.optional(zod.string()),
|
|
42
|
+
type: zod.optional(zod.string())
|
|
42
43
|
});
|
|
43
44
|
const selectedLogSchema = zod.object({
|
|
44
45
|
type: zod.literal('typedLogV2'),
|
package/lib/logger/logger.js
CHANGED
|
@@ -43,6 +43,7 @@ async function sendSelectedLog(logWithoutID) {
|
|
|
43
43
|
} catch (e) {}
|
|
44
44
|
newParts.push(newError.message, newError);
|
|
45
45
|
} else newParts.push(log.args[i]);
|
|
46
|
+
log.args = newParts;
|
|
46
47
|
if (!log.meta.stacktrace) try {
|
|
47
48
|
let frames = await getStacktrace();
|
|
48
49
|
const firstFrameIndex = frames.findIndex((frame)=>!frame.fileName.includes('node_modules/@lark-apaas/client-toolkit/lib/logger'));
|