revert accidental change to postgres.ts

This commit is contained in:
Hazelnoot 2024-10-11 09:44:12 -04:00
parent e3c79b0c83
commit 24fd35e03d

View file

@ -92,8 +92,6 @@ export const dbLogger = new MisskeyLogger('db');
const sqlLogger = dbLogger.createSubLogger('sql', 'gray'); const sqlLogger = dbLogger.createSubLogger('sql', 'gray');
class MyCustomLogger implements Logger { class MyCustomLogger implements Logger {
private readonly isDevelopment = process.env.NODE_ENV === 'development';
@bindThis @bindThis
private highlight(sql: string) { private highlight(sql: string) {
return highlight.highlight(sql, { return highlight.highlight(sql, {
@ -103,13 +101,7 @@ class MyCustomLogger implements Logger {
@bindThis @bindThis
public logQuery(query: string, parameters?: any[]) { public logQuery(query: string, parameters?: any[]) {
let message = this.highlight(query); sqlLogger.info(this.highlight(query).substring(0, 100));
if (!this.isDevelopment) {
message = message.substring(0, 100);
}
sqlLogger.info(message);
} }
@bindThis @bindThis