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,12 +1,12 @@
import assert from 'node:assert';
import crypto from 'node:crypto';
import database from './database.js';
import debugModule from 'debug';
import logger from './logger.js';
import mysql from 'mysql2';
import notifications from './notifications.js';
import safe from 'safetydance';
const debug = debugModule('box:eventlog');
const { log, trace } = logger('eventlog');
const ACTION_ACTIVATE = 'cloudron.activate';
const ACTION_USER_LOGIN = 'user.login';
@@ -119,7 +119,7 @@ async function cleanup(options) {
assert.strictEqual(typeof options, 'object');
const creationTime = options.creationTime;
debug(`cleanup: pruning events. creationTime: ${creationTime.toString()}`);
log(`cleanup: pruning events. creationTime: ${creationTime.toString()}`);
// only these actions are pruned
const actions = [