replace debug() with our custom logger

mostly we want trace() and log(). trace() can be enabled whenever
we want by flipping a flag and restarting box
This commit is contained in:
Girish Ramakrishnan
2026-03-12 22:55:28 +05:30
parent d57554a48c
commit 01d0c738bc
104 changed files with 1187 additions and 1174 deletions

View File

@@ -1,7 +1,7 @@
import assert from 'node:assert';
import AuditSource from '../auditsource.js';
import BoxError from '../boxerror.js';
import debugModule from 'debug';
import logger from '../logger.js';
import http from 'node:http';
import { HttpError } from '@cloudron/connect-lastmile';
import { HttpSuccess } from '@cloudron/connect-lastmile';
@@ -9,7 +9,7 @@ import mailServer from '../mailserver.js';
import safe from 'safetydance';
import services from '../services.js';
const debug = debugModule('box:routes/mailserver');
const { log, trace } = logger('routes/mailserver');
async function proxyToMailContainer(port, pathname, req, res, next) {
@@ -61,7 +61,7 @@ async function proxyAndRestart(req, res, next) {
if (httpError) return next(httpError);
// for success, the proxy already sent the response. do not proceed to connect-lastmile which will result in double headers
await safe(mailServer.restart(), { debug });
await safe(mailServer.restart(), { debug: log });
});
}