add filters for following feed

This commit is contained in:
Hazel K 2024-10-09 15:09:55 -04:00 committed by Hazelnoot
parent 56e7d7e0b1
commit 463b9ac59d
16 changed files with 318 additions and 72 deletions

View file

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