refactor(logs): move to core package (#4586)

This commit is contained in:
Meier Lukas
2025-12-16 23:37:44 +01:00
committed by GitHub
parent d86af072bf
commit d348abfe4a
145 changed files with 971 additions and 708 deletions

View File

@@ -11,13 +11,15 @@ import type { Pool as MysqlConnectionPool } from "mysql2";
import mysql from "mysql2";
import { Pool as PostgresPool } from "pg";
import { logger } from "@homarr/log";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { env } from "./env";
import * as mysqlSchema from "./schema/mysql";
import * as pgSchema from "./schema/postgresql";
import * as sqliteSchema from "./schema/sqlite";
const logger = createLogger({ module: "db" });
export type HomarrDatabase = BetterSQLite3Database<typeof sqliteSchema>;
export type HomarrDatabaseMysql = MySql2Database<typeof mysqlSchema>;
export type HomarrDatabasePostgresql = NodePgDatabase<typeof pgSchema>;
@@ -44,7 +46,7 @@ export let database: HomarrDatabase;
class WinstonDrizzleLogger implements Logger {
logQuery(query: string, _: unknown[]): void {
logger.debug(`Executed SQL query: ${query}`);
logger.debug("Executed SQL query", { query });
}
}

View File

@@ -47,7 +47,6 @@
"@homarr/common": "workspace:^0.1.0",
"@homarr/core": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/log": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@mantine/core": "^8.3.10",
"@paralleldrive/cuid2": "^3.1.0",