refactor: improve debug log messages
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 2 Aug 2023 15:38:15 +0000 (17:38 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 2 Aug 2023 15:38:15 +0000 (17:38 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Helpers.ts
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts

index 1dfc0f8029abe4927689566090bf498c67762c91..f263daa473be009ae0f5c4b980ed0b137012e2da 100644 (file)
@@ -863,7 +863,7 @@ export const prepareChargingProfileKind = (
     case ChargingProfileKindType.RELATIVE:
       if (!isNullOrUndefined(chargingProfile.chargingSchedule.startSchedule)) {
         logger.warn(
-          `${logPrefix} ${moduleName}.prepareChargingProfileKind: Charging profile id ${chargingProfile.chargingProfileId} has a startSchedule property defined. It will be ignored or set to the connector current transaction start date`,
+          `${logPrefix} ${moduleName}.prepareChargingProfileKind: Charging profile id ${chargingProfile.chargingProfileId} has a startSchedule property defined. It will be ignored or used if the connector has a transaction started`,
         );
         delete chargingProfile.chargingSchedule.startSchedule;
       }
index 222406c6ce84090f5b82fc1af5e5b7d3d783c2d1..502258c2552c670a5ef0f498a1858118e4f9372c 100644 (file)
@@ -942,6 +942,10 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
         !hasReservationExpired(chargingStationReservation) &&
         chargingStationReservation?.idTag === idTag)
     ) {
+      logger.debug(
+        `${chargingStation.logPrefix()} Connector id ${connectorId} has a valid reservation for idTag ${idTag}: %j`,
+        connectorReservation ?? chargingStationReservation,
+      );
       return true;
     }
     return false;