feat: add logger package to improve observability (#437)

* feat: add logger package to improve observability

* chore: add LOG_LEVEL to docker compose and readme
This commit is contained in:
Henry
2026-03-13 22:57:47 +00:00
committed by GitHub
parent 91deaca6ec
commit 1fb56aafd0
30 changed files with 440 additions and 123 deletions

View File

@@ -6,8 +6,12 @@ import { drizzle as drizzlePgLite } from "drizzle-orm/pglite";
import { migrate } from "drizzle-orm/pglite/migrator";
import { Pool } from "pg";
import { createLogger } from "@kan/logger";
import * as schema from "./schema";
const log = createLogger("db");
export type dbClient = NodePgDatabase<typeof schema> & {
$client: Pool;
};
@@ -16,7 +20,7 @@ export const createDrizzleClient = (): dbClient => {
const connectionString = process.env.POSTGRES_URL;
if (!connectionString) {
console.log("POSTGRES_URL environment variable is not set, using PGLite");
log.warn("POSTGRES_URL not set, falling back to PGLite");
const client = new PGlite({
dataDir: "./pgdata",

View File

@@ -402,8 +402,6 @@ export const softDeleteById = async (
.groupBy(lists.index)
.having(gt(countExpr, 1));
console.log(duplicateIndices);
if (duplicateIndices.length > 0) {
throw new Error(
`Duplicate indices found after reordering in board ${result.boardId}`,