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
+3 -3
View File
@@ -1,7 +1,7 @@
import assert from 'node:assert';
import BoxError from './boxerror.js';
import constants from './constants.js';
import debugModule from 'debug';
import logger from './logger.js';
import eventlog from './eventlog.js';
import oidcClients from './oidcclients.js';
import oidcServer from './oidcserver.js';
@@ -9,7 +9,7 @@ import settings from './settings.js';
import tokens from './tokens.js';
import users from './users.js';
const debug = debugModule('box:user-directory');
const { log, trace } = logger('user-directory');
async function getProfileConfig() {
@@ -30,7 +30,7 @@ async function setProfileConfig(profileConfig, options, auditSource) {
await eventlog.add(eventlog.ACTION_USER_DIRECTORY_PROFILE_CONFIG_UPDATE, auditSource, { oldConfig, config: profileConfig });
if (profileConfig.mandatory2FA && !oldConfig.mandatory2FA) {
debug('setProfileConfig: logging out non-2FA users to enforce 2FA');
log('setProfileConfig: logging out non-2FA users to enforce 2FA');
const allUsers = await users.list();