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:
@@ -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 });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user