From 88499f52f95a8030eb2186b918fac160b95e58a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 2 Aug 2023 17:38:15 +0200 Subject: [PATCH] refactor: improve debug log messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Helpers.ts | 2 +- src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 1dfc0f80..f263daa4 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -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; } diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 222406c6..502258c2 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -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; -- 2.34.1