enable logs in dev mode
MODIFY
src/storage/mongodb/MongoDBStorage.ts
src/storage/mongodb/MongoDBStorage.ts
@@ -342,7 +342,9 @@ export default class MongoDBStorage {
const foundIndex = indexes.find((index) => (JSON.stringify(index.fields) === JSON.stringify(databaseIndex.key)));
if (!foundIndex) {
// Drop indexes
+ if (Utils.isDevMode()) {
console.log(`Drop index ${JSON.stringify(databaseIndex.key)} on collection ${tenantID}.${name}`);
+ }
await this.db.collection(tenantCollectionName).dropIndex(databaseIndex.key);
}
}
@@ -353,7 +355,9 @@ export default class MongoDBStorage {
const foundIndex = databaseIndexes.find((existingIndex) => (JSON.stringify(existingIndex.key) === JSON.stringify(index.fields)));
if (!foundIndex) {
// Create Indexes
+ if (Utils.isDevMode()) {
console.log(`Create index ${JSON.stringify(index)} on collection ${tenantID}.${name}`);
+ }
// eslint-disable-next-line @typescript-eslint/await-thenable
await this.db.collection(tenantCollectionName).createIndex(index.fields, index.options);
}

MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -753,7 +753,9 @@ export default class Logging {
delete Logging.traceCalls[`${chargeBoxID}~action`];
found = true;
}
- console.log(`${direction} OCPP Request has been processed ${found ? 'in ' + executionDurationSecs.toString() + ' secs' : ''}`);
+ if (Utils.isDevMode()) {
+ console.log(`${direction} OCPP Request '${action}' on '${chargeBoxID}' has been processed ${found ? 'in ' + executionDurationSecs.toString() + ' secs' : ''}`);
+ }
if (detailedMessages && detailedMessages['status'] && detailedMessages['status'] === 'Rejected') {
Logging.logError({
tenantID: tenantID,

enable logs in dev mode