]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor(simulator): harmonize OCPP sent-message log prefix
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 14 Jun 2026 23:34:37 +0000 (01:34 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 14 Jun 2026 23:34:37 +0000 (01:34 +0200)
Add moduleName constant and prefix the SENT command log with
'OCPPRequestService.internalSendMessage:' to match the format of the
3 received-message logs in ChargingStation.ts (handleErrorMessage,
handleIncomingMessage, handleResponseMessage).

src/charging-station/ocpp/OCPPRequestService.ts

index 771d8dd1b28cb7c9abeb4aa346bde0be6a70de7c..46b4cf2a75038a6252a79afc300af4474255f385 100644 (file)
@@ -38,6 +38,8 @@ const defaultRequestParams: RequestParams = {
   triggerMessage: false,
 }
 
+const moduleName = 'OCPPRequestService'
+
 export abstract class OCPPRequestService {
   private static readonly instances = new Map<
     new (ocppResponseService: OCPPResponseService) => OCPPRequestService,
@@ -407,7 +409,7 @@ export abstract class OCPPRequestService {
             clearTimeout(sendTimeout)
             if (error == null) {
               logger.debug(
-                `${chargingStation.logPrefix()} >> Command '${commandName}' sent ${getMessageTypeString(
+                `${chargingStation.logPrefix()} ${moduleName}.internalSendMessage: >> Command '${commandName}' sent ${getMessageTypeString(
                   messageType
                 )} payload: ${messageToSend}`
               )