Remove debug logging and add feature documentation

- Remove all console.log statements added during development
- Clean up code for production readiness
This commit is contained in:
Craig Lawson committed 2026-01-11 18:56:16 +00:00
1 parent 76ab2695db
commit 7b619e6b31
4 files changed
+2 -29

No files matched your search

-5
View File
@@ -80,9 +80,6 @@ const Settings = () => {
const handleChange = async (e) => {
const { name, value, checked } = e.target;
// eslint-disable-next-line no-console
console.log("=== SETTINGS HANDLER CHANGE ===", { name, value, checked, type: typeof value });
let newValue;
if (
name === "systemEmailIgnoreTLS" ||
@@ -179,8 +176,6 @@ const Settings = () => {
};
const handleSave = () => {
// eslint-disable-next-line no-console
console.log("=== HANDLE SAVE ===", { settingsDataSettings: settingsData?.settings });
const { error } = settingsValidation.validate(settingsData.settings, {
abortEarly: false,
});
@@ -57,10 +57,6 @@ class SettingsController {
};
updateAppSettings = async (req: Request, res: Response, next: NextFunction) => {
// Diagnostics: capture inbound payload
// eslint-disable-next-line no-console
console.log("=== SETTINGS CONTROLLER REQUEST BODY ===", req.body);
await updateAppSettingsBodyValidation.validateAsync(req.body);
const updatedSettings = await this.db.settingsModule.updateAppSettings(req.body);
@@ -8,11 +8,6 @@ class SettingsModule {
updateAppSettings = async (newSettings) => {
try {
// eslint-disable-next-line no-console
console.log("=== SETTINGS MODULE UPDATE ===");
// eslint-disable-next-line no-console
console.log("Incoming showURL:", newSettings.showURL, "type:", typeof newSettings.showURL);
const update = { $set: { ...newSettings } };
if (newSettings.pagespeedApiKey === "") {
@@ -29,8 +24,6 @@ class SettingsModule {
upsert: true,
});
const settings = await this.AppSettings.findOne().select("-__v -_id -createdAt -updatedAt -singleton").lean();
// eslint-disable-next-line no-console
console.log("Saved showURL:", settings.showURL, "type:", typeof settings.showURL);
return settings;
} catch (error) {
error.service = SERVICE_NAME;
+2 -13
View File
@@ -261,20 +261,9 @@ class StatusPageModule {
const { statusPage, monitors } = statusPageQuery[0];
const appSettings = await this.AppSettings.findOne({ singleton: true }).lean();
const showURL = appSettings?.showURL === true || appSettings?.showURL === "true";
const showURL = appSettings?.showURL === true;
// eslint-disable-next-line no-console
console.log("=== STATUS PAGE FETCH ===");
// eslint-disable-next-line no-console
console.log("appSettings object:", JSON.stringify(appSettings, null, 2));
// eslint-disable-next-line no-console
console.log("appSettings.showURL value:", appSettings?.showURL);
// eslint-disable-next-line no-console
console.log("appSettings.showURL type:", typeof appSettings?.showURL);
// eslint-disable-next-line no-console
console.log("showURL after check:", showURL);
const normalizedMonitors = monitors.map((monitor) => {
const normalizedMonitors = monitors.map((monitor) => {
const normalizedChecks = this.NormalizeData(monitor.checks, 10, 100);
if (showURL !== true) {
const { url, port, secret, notifications, ...rest } = monitor;