feat(logger): setup logger with discord and db logging

This commit is contained in:
2025-08-31 21:35:50 -05:00
parent fc3cfe999a
commit 2e51474a5e
13 changed files with 1577 additions and 20 deletions

View File

@@ -0,0 +1,21 @@
import { boolean, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import { z } from "zod";
export const logs = pgTable("logs", {
log_id: uuid("log_id").defaultRandom().primaryKey(),
level: text("level"),
module: text("module").notNull(),
subModule: text("subModule"),
message: text("message").notNull(),
stack: text("stack"),
checked: boolean("checked").default(false),
hostname: text("hostname"),
createdAt: timestamp("createdAt").defaultNow(),
});
export const logSchema = createSelectSchema(logs);
export const newSettingSchema = createInsertSchema(logs);
export type Log = z.infer<typeof logSchema>;
export type NewLog = z.infer<typeof newSettingSchema>;