socket io stuff entered

This commit is contained in:
2026-03-12 15:05:37 -05:00
parent bf7d765989
commit 81dc575b4f
44 changed files with 234 additions and 6895 deletions

View File

@@ -18,6 +18,7 @@ interface Data<T = unknown[]> {
| "settings";
level: "info" | "error" | "debug" | "fatal";
message: string;
room?: string;
data?: T;
notify?: boolean;
}
@@ -38,20 +39,21 @@ interface Data<T = unknown[]> {
*/
export const returnFunc = (data: Data) => {
const notify = data.notify ? data.notify : false;
const room = data.room ?? data.room;
const log = createLogger({ module: data.module, subModule: data.subModule });
// handle the logging part
switch (data.level) {
case "info":
log.info({ notify: notify }, data.message);
log.info({ notify: notify, room }, data.message);
break;
case "error":
log.error({ notify: notify, error: data.data }, data.message);
log.error({ notify: notify, error: data.data, room }, data.message);
break;
case "debug":
log.debug({ notify: notify }, data.message);
log.debug({ notify: notify, room }, data.message);
break;
case "fatal":
log.fatal({ notify: notify }, data.message);
log.fatal({ notify: notify, room }, data.message);
}
// api section to return