From: Jérôme Benoit Date: Wed, 13 Apr 2022 20:13:57 +0000 (+0200) Subject: Log early OCPP command payload X-Git-Tag: v1.1.57~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=sidebyside;h=5c370ef3558b0809c6086b25fc967fa040823740;p=e-mobility-charging-stations-simulator.git Log early OCPP command payload Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 81855cec..4ed293e4 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1504,17 +1504,17 @@ export default class ChargingStation { if (this.getEnableStatistics()) { this.performanceStatistics.addRequestStatistic(commandName, messageType); } + logger.debug( + `${this.logPrefix()} << Command '${commandName}' received request payload: ${JSON.stringify( + request + )}` + ); // Process the call await this.ocppIncomingRequestService.handleRequest( messageId, commandName, commandPayload ); - logger.debug( - `${this.logPrefix()} << Command '${commandName}' received request payload: ${JSON.stringify( - request - )}` - ); break; // Outcome Message case MessageType.CALL_RESULT_MESSAGE: @@ -1529,6 +1529,11 @@ export default class ChargingStation { requestCommandName ); } + logger.debug( + `${this.logPrefix()} << Command '${requestCommandName}' received response payload: ${JSON.stringify( + request + )}` + ); if (!responseCallback) { // Error throw new OCPPError( @@ -1538,11 +1543,6 @@ export default class ChargingStation { ); } responseCallback(commandName, requestPayload); - logger.debug( - `${this.logPrefix()} << Command '${requestCommandName}' received response payload: ${JSON.stringify( - request - )}` - ); break; // Error Message case MessageType.CALL_ERROR_MESSAGE: @@ -1555,6 +1555,11 @@ export default class ChargingStation { `Cached request for message id ${messageId} error response is not iterable` ); } + logger.debug( + `${this.logPrefix()} << Command '${requestCommandName}' received error payload: ${JSON.stringify( + request + )}` + ); if (!rejectCallback) { // Error throw new OCPPError( @@ -1566,11 +1571,6 @@ export default class ChargingStation { rejectCallback( new OCPPError(commandName, commandPayload.toString(), requestCommandName, errorDetails) ); - logger.debug( - `${this.logPrefix()} << Command '${requestCommandName}' received error payload: ${JSON.stringify( - request - )}` - ); break; // Error default: