Skip to content

Commit b9713f4

Browse files
committed
fix: possible fix to log format validation
1 parent bd0f814 commit b9713f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/src/plugins/Logs/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const MAX_BATCH_TIME = 5000;
3030
// A bit of a workaround so we can pass LogType keys to z.enum()
3131
const logTypes = keys(LogType);
3232
const logTypeProps = logTypes.reduce((map, type) => {
33-
map[type] = zMessageContent;
33+
map[type] = zMessageContent.default(DefaultLogMessages[type] || "");
3434
return map;
3535
}, {} as Record<keyof typeof LogType, typeof zMessageContent>);
3636
const zLogFormats = z.strictObject(logTypeProps);
@@ -58,7 +58,7 @@ export type TLogChannelMap = z.infer<typeof zLogChannelMap>;
5858

5959
export const zLogsConfig = z.strictObject({
6060
channels: zLogChannelMap.default({}),
61-
format: zLogFormats.default(DefaultLogMessages),
61+
format: zLogFormats,
6262
// Legacy/deprecated, if below is false mentions wont actually ping. In case you really want the old behavior, set below to true
6363
ping_user: z.boolean().default(true),
6464
allow_user_mentions: z.boolean().default(false),

0 commit comments

Comments
 (0)