Skip to content

Commit

Permalink
more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Jul 25, 2024
1 parent ce03563 commit 111e2e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/test/unit/logging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ describe('Logger instances and transports tests', async () => {
expect(OCEAN_NODE_LOGGER.hasDBTransport()).to.be.equal(false)
const envAfter = await setupEnvironment(
null,
buildEnvOverrideConfig(
[ENVIRONMENT_VARIABLES.LOG_DB, ENVIRONMENT_VARIABLES.DB_URL],
['true', 'http://172.15.0.6:8108?apiKey=xyz']
)
buildEnvOverrideConfig([ENVIRONMENT_VARIABLES.LOG_DB], ['true'])
)
console.log('env after', envAfter)
expect(USE_DB_TRANSPORT()).to.be.equal(true)
// will build the DB transport layer
console.log('before config')
const config = await getConfiguration(true)
console.log('after config: ', config)
// eslint-disable-next-line no-unused-vars
const DB = await new Database(config.dbConfig)
console.log('after DB')
Expand Down
2 changes: 1 addition & 1 deletion src/test/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const mochaHooks = {
if (initialVariable.originalValue !== currentEnvVariable.originalValue) {
// reset it to the original
CONFIG_LOGGER.debug(
`(Hook) Restoring environment variable: ${varName} \ncurrent:\n ${process.env[varName]} original:\n ' ${initialVariable.originalValue}`
`(Hook) Restoring environment variable: ${varName} \ncurrent:\n ${process.env[varName]} \noriginal:\n ${initialVariable.originalValue}`
)
}
})
Expand Down
1 change: 1 addition & 0 deletions src/utils/logging/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ export function configureCustomDBTransport(
}
if (!logger.hasDBTransport()) {
logger.addTransport(customDBTransport)
logger.logMessage('Adding DB transport to Logger: ' + logger.getModuleName())
}
return logger
}

0 comments on commit 111e2e6

Please sign in to comment.