refactor: migrate bot/ to a sensible logging solution

This commit is contained in:
zk
2026-03-12 20:19:27 +00:00
parent fc3e2bf8e1
commit d7bb9541f6
29 changed files with 175 additions and 221 deletions
+3 -2
View File
@@ -95,6 +95,7 @@
"node-html-parser": "catalog:",
"nodemailer": "catalog:",
"pg": "catalog:",
"pino": "catalog:",
"prudence": "catalog:",
"rate-limit-redis": "catalog:",
"redis": "catalog:",
@@ -107,10 +108,10 @@
"ts-node": "catalog:",
"typescript": "catalog:",
"uuidv7": "catalog:",
"zod": "catalog:",
"winston": "catalog:",
"winston-loki": "catalog:",
"winston-transport": "catalog:"
"winston-transport": "catalog:",
"zod": "catalog:"
},
"nyc": {
"reporter": [
@@ -23,7 +23,7 @@ async function CloseEverythingElse() {
logger.info("Closing Mongo Database.", { shutdownInfo: true });
await monkDB.close();
logger.info("Closing database...", {shutdownInfo: true});
logger.info("Closing database...", { shutdownInfo: true });
await ClosePgConnection();
logger.info("Closing Redis Connection.", { shutdownInfo: true });
@@ -120,7 +120,6 @@ const tports: Array<winston.transport> = [
}),
];
export const rootLogger = winston.createLogger({
levels: {
// entire process termination is necessary
+1 -2
View File
@@ -1,5 +1,5 @@
import JSON5 from "json5";
import { allSupportedGameGroups, type GameGroup , type ImportTypes } from "tachi-common";
import { allSupportedGameGroups, type GameGroup, type ImportTypes } from "tachi-common";
import { allImportTypes } from "tachi-common/constants/import-types";
import { z } from "zod";
@@ -198,7 +198,6 @@ if (!["crit", "debug", "error", "info", "severe", "verbose", "warn"].includes(lo
process.exit(1);
}
const POSTGRES_URL = process.env.POSTGRES_URL ?? "";
if (!POSTGRES_URL) {
+1 -4
View File
@@ -51,10 +51,7 @@ const userSessionMiddleware = expressSession({
ServerConfig.ENABLE_SERVER_HTTPS,
// Very important. Without this, we're vulnerable to CSRF!
sameSite:
Env.NODE_ENV === "production" || Env.NODE_ENV === "staging"
? "strict"
: "none",
sameSite: Env.NODE_ENV === "production" || Env.NODE_ENV === "staging" ? "strict" : "none",
},
});