From e09d1ddb5d9be7bc92cedb481a4da31881d5e0d4 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Fri, 25 Apr 2025 11:19:19 -0400 Subject: [PATCH] debug logging alignment --- app.js | 4 ++-- app.ts | 4 ++-- bin/wwwProcess.js | 2 +- bin/wwwProcess.ts | 2 +- helpers/database.helpers.js | 2 +- helpers/database.helpers.ts | 2 +- helpers/functions.cache.js | 2 +- helpers/functions.cache.ts | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app.js b/app.js index dbc2a87c..30b2dd0f 100644 --- a/app.js +++ b/app.js @@ -28,7 +28,7 @@ import routerPrint from './routes/print.js'; import routerReports from './routes/reports.js'; import routerWorkOrders from './routes/workOrders.js'; import { version } from './version.js'; -const debug = Debug(`${DEBUG_NAMESPACE}:app:${process.pid}`); +const debug = Debug(`${DEBUG_NAMESPACE}:app:${process.pid.toString().padEnd(5)}`); /* * INITIALIZE APP */ @@ -79,7 +79,7 @@ app.use(session({ }, secret: configFunctions.getConfigProperty('session.secret'), store: new FileStoreSession({ - logFn: Debug(`${DEBUG_NAMESPACE}:session:${process.pid}`), + logFn: Debug(`${DEBUG_NAMESPACE}:session:${process.pid.toString().padEnd(5)}`), path: './data/sessions', retries: 20 }), diff --git a/app.ts b/app.ts index 2c84fb82..32fae2e4 100644 --- a/app.ts +++ b/app.ts @@ -31,7 +31,7 @@ import routerReports from './routes/reports.js' import routerWorkOrders from './routes/workOrders.js' import { version } from './version.js' -const debug = Debug(`${DEBUG_NAMESPACE}:app:${process.pid}`) +const debug = Debug(`${DEBUG_NAMESPACE}:app:${process.pid.toString().padEnd(5)}`) /* * INITIALIZE APP @@ -107,7 +107,7 @@ app.use( }, secret: configFunctions.getConfigProperty('session.secret'), store: new FileStoreSession({ - logFn: Debug(`${DEBUG_NAMESPACE}:session:${process.pid}`), + logFn: Debug(`${DEBUG_NAMESPACE}:session:${process.pid.toString().padEnd(5)}`), path: './data/sessions', retries: 20 }), diff --git a/bin/wwwProcess.js b/bin/wwwProcess.js index deb4d513..22e2c3d6 100644 --- a/bin/wwwProcess.js +++ b/bin/wwwProcess.js @@ -7,7 +7,7 @@ import { app } from '../app.js'; import { initializeDatabase } from '../database/initializeDatabase.js'; import { DEBUG_NAMESPACE } from '../debug.config.js'; import { getConfigProperty } from '../helpers/config.helpers.js'; -const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid}`); +const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid.toString().padEnd(5)}`); if (process.send === undefined) { // INITIALIZE THE DATABASE await initializeDatabase(); diff --git a/bin/wwwProcess.ts b/bin/wwwProcess.ts index 9d486862..59fdf9e5 100644 --- a/bin/wwwProcess.ts +++ b/bin/wwwProcess.ts @@ -11,7 +11,7 @@ import { initializeDatabase } from '../database/initializeDatabase.js' import { DEBUG_NAMESPACE } from '../debug.config.js' import { getConfigProperty } from '../helpers/config.helpers.js' -const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid}`) +const debug = Debug(`${DEBUG_NAMESPACE}:wwwProcess:${process.pid.toString().padEnd(5)}`) if (process.send === undefined) { // INITIALIZE THE DATABASE diff --git a/helpers/database.helpers.js b/helpers/database.helpers.js index 483df8cf..cc13e5a1 100644 --- a/helpers/database.helpers.js +++ b/helpers/database.helpers.js @@ -2,7 +2,7 @@ import fs from 'node:fs/promises'; import Debug from 'debug'; import { DEBUG_NAMESPACE } from '../debug.config.js'; import { getConfigProperty } from './config.helpers.js'; -const debug = Debug(`${DEBUG_NAMESPACE}:database.helpers:${process.pid}`); +const debug = Debug(`${DEBUG_NAMESPACE}:database.helpers:${process.pid.toString().padEnd(5)}`); export const useTestDatabases = getConfigProperty('application.useTestDatabases') || process.env.TEST_DATABASES === 'true'; if (useTestDatabases) { diff --git a/helpers/database.helpers.ts b/helpers/database.helpers.ts index 3e6e76df..9b0122fd 100644 --- a/helpers/database.helpers.ts +++ b/helpers/database.helpers.ts @@ -6,7 +6,7 @@ import { DEBUG_NAMESPACE } from '../debug.config.js' import { getConfigProperty } from './config.helpers.js' -const debug = Debug(`${DEBUG_NAMESPACE}:database.helpers:${process.pid}`) +const debug = Debug(`${DEBUG_NAMESPACE}:database.helpers:${process.pid.toString().padEnd(5)}`) export const useTestDatabases = getConfigProperty('application.useTestDatabases') || diff --git a/helpers/functions.cache.js b/helpers/functions.cache.js index b455cc1c..dcff3468 100644 --- a/helpers/functions.cache.js +++ b/helpers/functions.cache.js @@ -12,7 +12,7 @@ import getWorkOrderMilestoneTypesFromDatabase from '../database/getWorkOrderMile import getWorkOrderTypesFromDatabase from '../database/getWorkOrderTypes.js'; import { DEBUG_NAMESPACE } from '../debug.config.js'; import { getConfigProperty } from './config.helpers.js'; -const debug = Debug(`${DEBUG_NAMESPACE}:functions.cache:${process.pid}`); +const debug = Debug(`${DEBUG_NAMESPACE}:functions.cache:${process.pid.toString().padEnd(5)}`); /* * Burial Site Statuses */ diff --git a/helpers/functions.cache.ts b/helpers/functions.cache.ts index e62c722b..1a0ff919 100644 --- a/helpers/functions.cache.ts +++ b/helpers/functions.cache.ts @@ -31,7 +31,7 @@ import type { import { getConfigProperty } from './config.helpers.js' -const debug = Debug(`${DEBUG_NAMESPACE}:functions.cache:${process.pid}`) +const debug = Debug(`${DEBUG_NAMESPACE}:functions.cache:${process.pid.toString().padEnd(5)}`) /* * Burial Site Statuses