From: Jérôme Benoit Date: Wed, 1 Jun 2022 20:19:57 +0000 (+0200) Subject: Simplify ATG logPrefix() method X-Git-Tag: v1.1.61~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6cd85def67fcc51dfa978127ec4a7a776427b135;p=e-mobility-charging-stations-simulator.git Simplify ATG logPrefix() method Signed-off-by: Jérôme Benoit --- diff --git a/package-lock.json b/package-lock.json index d03035d2..3216c9af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,7 @@ "prettier": "^2.6.2", "release-it": "^15.0.0", "robohydra": "^0.6.9", - "rollup": "^2.75.4", + "rollup": "^2.75.5", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-delete": "^2.0.0", @@ -13922,9 +13922,9 @@ } }, "node_modules/rollup": { - "version": "2.75.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.4.tgz", - "integrity": "sha512-JgZiJMJkKImMZJ8ZY1zU80Z2bA/TvrL/7D9qcBCrfl2bP+HUaIw0QHUroB4E3gBpFl6CRFM1YxGbuYGtdAswbQ==", + "version": "2.75.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.5.tgz", + "integrity": "sha512-JzNlJZDison3o2mOxVmb44Oz7t74EfSd1SQrplQk0wSaXV7uLQXtVdHbxlcT3w+8tZ1TL4r/eLfc7nAbz38BBA==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -28061,9 +28061,9 @@ } }, "rollup": { - "version": "2.75.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.4.tgz", - "integrity": "sha512-JgZiJMJkKImMZJ8ZY1zU80Z2bA/TvrL/7D9qcBCrfl2bP+HUaIw0QHUroB4E3gBpFl6CRFM1YxGbuYGtdAswbQ==", + "version": "2.75.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.5.tgz", + "integrity": "sha512-JzNlJZDison3o2mOxVmb44Oz7t74EfSd1SQrplQk0wSaXV7uLQXtVdHbxlcT3w+8tZ1TL4r/eLfc7nAbz38BBA==", "dev": true, "requires": { "fsevents": "~2.3.2" diff --git a/package.json b/package.json index 4cd71187..cbcc6b14 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "prettier": "^2.6.2", "release-it": "^15.0.0", "robohydra": "^0.6.9", - "rollup": "^2.75.4", + "rollup": "^2.75.5", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-delete": "^2.0.0", diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index fedda8ef..31f07168 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -103,7 +103,7 @@ export default class AutomaticTransactionGenerator { } private async internalStartConnector(connectorId: number): Promise { - this.initStartConnectorStatus(connectorId); + this.initializeConnectorStatus(connectorId); logger.info( this.logPrefix(connectorId) + ' started on connector and will run for ' + @@ -238,7 +238,7 @@ export default class AutomaticTransactionGenerator { }); } - private initStartConnectorStatus(connectorId: number): void { + private initializeConnectorStatus(connectorId: number): void { this.connectorsStatus.get(connectorId).authorizeRequests = this?.connectorsStatus.get(connectorId)?.authorizeRequests ?? 0; this.connectorsStatus.get(connectorId).acceptedAuthorizeRequests = @@ -388,15 +388,10 @@ export default class AutomaticTransactionGenerator { } private logPrefix(connectorId?: number): string { - if (connectorId) { - return Utils.logPrefix( - ' ' + - this.chargingStation.stationInfo.chargingStationId + - ' | ATG on connector #' + - connectorId.toString() + - ':' - ); - } - return Utils.logPrefix(' ' + this.chargingStation.stationInfo.chargingStationId + ' | ATG:'); + return Utils.logPrefix( + ` ${this.chargingStation.stationInfo.chargingStationId} | ATG${ + connectorId && ` on connector #${connectorId.toString()}` + }:` + ); } }