refactor(logging): when notify is true send the error to systemAdmins
This commit is contained in:
@@ -5,6 +5,7 @@ import { db } from "../db/db.controller.js";
|
||||
import { logs } from "../db/schema/logs.schema.js";
|
||||
import { emitToRoom } from "../socket.io/roomEmitter.socket.js";
|
||||
import { tryCatch } from "../utils/trycatch.utils.js";
|
||||
import { notifySystemIssue } from "./logger.notify.js";
|
||||
//import build from "pino-abstract-transport";
|
||||
|
||||
export const logLevel = process.env.LOG_LEVEL || "info";
|
||||
@@ -45,6 +46,10 @@ const dbStream = new Writable({
|
||||
console.error(res.error);
|
||||
}
|
||||
|
||||
if (obj.notify) {
|
||||
notifySystemIssue(obj);
|
||||
}
|
||||
|
||||
if (obj.room) {
|
||||
emitToRoom(obj.room, res.data ? res.data[0] : obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user