diff --git a/packages/backend/package.json b/packages/backend/package.json index a8b9fda2c..53b477163 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -32,7 +32,6 @@ "bull": "4.8.4", "cacheable-lookup": "6.0.4", "cbor": "8.1.0", - "cli-highlight": "2.1.11", "color-convert": "2.0.1", "content-disposition": "0.5.4", "date-fns": "2.28.0", diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index 343eef3f7..eae50c346 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -4,7 +4,6 @@ import pg from 'pg'; pg.types.setTypeParser(20, Number); import { Logger, DataSource } from 'typeorm'; -import * as highlight from 'cli-highlight'; import config from '@/config/index.js'; import { SECOND } from '@/const.js'; @@ -74,22 +73,16 @@ import { dbLogger } from './logger.js'; const sqlLogger = dbLogger.createSubLogger('sql'); class MyCustomLogger implements Logger { - private highlight(sql: string): string { - return highlight.highlight(sql, { - language: 'sql', ignoreIllegals: true, - }); - } - public logQuery(query: string): void { - sqlLogger.info(this.highlight(query).substring(0, 100)); + sqlLogger.info(query); } public logQueryError(error: string, query: string): void { - sqlLogger.error(this.highlight(query)); + sqlLogger.error(query); } public logQuerySlow(time: number, query: string): void { - sqlLogger.warn(this.highlight(query)); + sqlLogger.warn(query); } public logSchemaBuild(message: string): void {