Skip to content

Commit 5d21f8c

Browse files
committed
Removing reduntant loggers
1 parent 880faef commit 5d21f8c

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

kilkari/src/main/java/org/motechproject/nms/kilkari/service/impl/CsrServiceImpl.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ private void handleDndForSubscription(Subscription subscription) {
147147
private void doReschedule(Subscription subscription, CallRetry existingCallRetry, CallSummaryRecordDto csrDto) {
148148

149149
boolean invalidNr = StatusCode.fromInt(csrDto.getStatusCode()).equals(StatusCode.OBD_FAILED_INVALIDNUMBER);
150-
LOGGER.info("inside doreshedule method");
151-
LOGGER.info("this is the data inside: {},{},{]",subscription,existingCallRetry, csrDto);
152150
if (existingCallRetry == null && SubscriptionStatus.ACTIVE.equals(subscription.getStatus())) {
153151
LOGGER.info("inside condition 1");
154152
// We've never retried this call, let's do it
@@ -171,25 +169,21 @@ private void doReschedule(Subscription subscription, CallRetry existingCallRetry
171169

172170
if ((subscription.getSubscriptionPack().retryCount() == 1) ||
173171
(existingCallRetry !=null && existingCallRetry.getCallStage() == CallStage.RETRY_LAST)) {
174-
LOGGER.info("inside condition 2");
175172
// This call should not be retried
176173

177174
// Deactivate subscription for persistent invalid numbers
178175
// See https://github.com/motech-implementations/mim/issues/169
179176
if (existingCallRetry != null && existingCallRetry.getInvalidNumberCount() != null &&
180177
existingCallRetry.getInvalidNumberCount() == subscription.getSubscriptionPack().retryCount()) {
181-
LOGGER.info("inside condition 3");
182178
subscription.setStatus(SubscriptionStatus.DEACTIVATED);
183179
subscription.setDeactivationReason(DeactivationReason.INVALID_NUMBER);
184180
subscriptionDataService.update(subscription);
185181
SubscriptionServiceImpl.createDeactivatedUser(deactivatedBeneficiaryDataService, subscription, DeactivationReason.INVALID_NUMBER, false);
186182
}
187183
if (existingCallRetry != null && existingCallRetry.isOpt_in_call_eligibility()
188184
&& existingCallRetry.getCallStage() == CallStage.RETRY_LAST && existingCallRetry.getWeekId().equals("w1_1")) {
189-
LOGGER.info("inside condition 4");
190185
boolean optInCall = existingCallRetry.getContentFileName().equals("opt_in.wav");
191186
if(!optInCall) {
192-
LOGGER.info("inside condition 5");
193187
/*callRetryDataService.delete(existingCallRetry);
194188
callRetryDataService.create(new CallRetry(
195189
subscription.getSubscriptionId(),
@@ -208,12 +202,8 @@ private void doReschedule(Subscription subscription, CallRetry existingCallRetry
208202
existingCallRetry.setContentFileName("opt_in.wav");
209203
callRetryDataService.update(existingCallRetry);
210204
} else {
211-
LOGGER.info("inside condition 6");
212205
completeSubscriptionIfNeeded(subscription, csrDto.getContentFileName());
213206
callRetryDataService.delete(existingCallRetry);
214-
LOGGER.info("subscription is : {}", subscription);
215-
LOGGER.info("csrDto is : {}", csrDto);
216-
LOGGER.info("whatsAppOptSMSDataService is : {}", whatsAppOptSMSDataService);
217207
// write message table logic here
218208
whatsAppOptSMSDataService.create(new WhatsAppOptSMS(csrDto.getCircleName(),
219209
"SMS_CONTENT",
@@ -230,7 +220,6 @@ private void doReschedule(Subscription subscription, CallRetry existingCallRetry
230220
return;
231221
}
232222
if (existingCallRetry != null) {
233-
LOGGER.info("inside condition 7");
234223
callRetryDataService.delete(existingCallRetry);
235224
}
236225

@@ -243,7 +232,6 @@ private void doReschedule(Subscription subscription, CallRetry existingCallRetry
243232

244233
// This call should indeed be re-rescheduled
245234
if (existingCallRetry != null) {
246-
LOGGER.info("inside condition 8");
247235
existingCallRetry.setCallStage(existingCallRetry.getCallStage().nextStage());
248236
existingCallRetry.setInvalidNumberCount(existingCallRetry.getInvalidNumberCount() == null ? 0 :
249237
(existingCallRetry.getInvalidNumberCount() + (invalidNr ? 1 : 0)));
@@ -307,9 +295,7 @@ public void processCallSummaryRecord(MotechEvent event) { //NOPMD NcssMethodCoun
307295
String subscriptionId = "###INVALID###";
308296
try {
309297
CallSummaryRecordDto csrDto = CallSummaryRecordDto.fromParams(event.getParameters());
310-
LOGGER.info("this is csr dto : {}",csrDto);
311298
subscriptionId = csrDto.getSubscriptionId();
312-
LOGGER.info("this is the subscriptionId: {}",subscriptionId);
313299
csrVerifierService.verify(csrDto);
314300

315301
Subscription subscription = subscriptionDataService.findBySubscriptionId(subscriptionId);
@@ -318,13 +304,10 @@ public void processCallSummaryRecord(MotechEvent event) { //NOPMD NcssMethodCoun
318304
}
319305

320306
CallRetry callRetry = callRetryDataService.findBySubscriptionId(subscriptionId);
321-
LOGGER.info("this is call retry: {}",callRetry);
322-
LOGGER.info("this is the final status: {}",FinalCallStatus.fromInt(csrDto.getFinalStatus()));
323307
switch (FinalCallStatus.fromInt(csrDto.getFinalStatus())) {
324308
case SUCCESS:
325309
completeSubscriptionIfNeeded(subscription, csrDto.getContentFileName());
326310
if (callRetry != null) {
327-
328311
if (!callRetry.getContentFileName().equals("opt_in.wav")) {
329312
callRetryDataService.delete(callRetry);
330313
}
@@ -341,20 +324,8 @@ public void processCallSummaryRecord(MotechEvent event) { //NOPMD NcssMethodCoun
341324
//If there was a DOB/LMP update during RCH import, number of weeks into subscription would have changed.
342325
//No need to reschedule this call. Exception for w1, because regardless of which week the subscription starts in, user
343326
//always gets w1 message initially
344-
LOGGER.info("this is the data: {},{}",csrDto.getWeekId(),weekId);
345-
346-
347-
348-
349-
LOGGER.info("this is data in db for week: {}",subscription.getFirstMessageDayOfWeek());
350-
LOGGER.info("this is data in csrdto: {}",DayOfTheWeek.getDayOfTheWeekFromTimestamp(csrDto.getTargetFileTimeStamp()));
351-
LOGGER.info("this is the condition1: {}",!subscription.getFirstMessageDayOfWeek().equals(DayOfTheWeek.getDayOfTheWeekFromTimestamp(csrDto.getTargetFileTimeStamp())));
352-
LOGGER.info("this is condition 2: {}", "1".equals(extractRouteNumber(csrDto.getServiceId())));
353-
LOGGER.info("this is condition 2 and return : {}",extractRouteNumber(csrDto.getServiceId()));
354-
LOGGER.info("this is service id: {}",csrDto.getServiceId());
355327
if(!csrDto.getWeekId().equals("w1_1")&&!weekId.equals(csrDto.getWeekId())){
356328
if(callRetry!=null){
357-
LOGGER.info("inside call retry condition");
358329
callRetryDataService.delete(callRetry);
359330
}
360331
}else if(callRetry == null && !csrDto.getWeekId().equals("w1_1") && !subscription.getFirstMessageDayOfWeek().equals(DayOfTheWeek.getDayOfTheWeekFromTimestamp(csrDto.getTargetFileTimeStamp())) && "1".equals(extractRouteNumber(csrDto.getServiceId()))) {
@@ -365,7 +336,6 @@ public void processCallSummaryRecord(MotechEvent event) { //NOPMD NcssMethodCoun
365336
LOGGER.info("this is the data2: {}",csrDto.getTargetFileTimeStamp());
366337
if (callRetry == null ||
367338
!csrDto.getTargetFileTimeStamp().equals(callRetry.getTargetFiletimestamp())){
368-
LOGGER.info("inside fresh or retryupdate else condition");
369339
doReschedule(subscription, callRetry, csrDto);
370340
}
371341
}
@@ -410,10 +380,8 @@ public void processCallSummaryRecord(MotechEvent event) { //NOPMD NcssMethodCoun
410380

411381
private String extractRouteNumber(String serviceId) {
412382
if (serviceId != null && serviceId.contains("Retryonroute")) {
413-
LOGGER.info("inside this1");
414383
int startIndex = serviceId.indexOf("Retryonroute") + "Retryonroute".length();
415384
if (startIndex < serviceId.length()) {
416-
LOGGER.info("inside this2");
417385
return String.valueOf(serviceId.charAt(startIndex));
418386
}
419387
}

kilkari/src/main/java/org/motechproject/nms/kilkari/service/impl/SubscriberServiceImpl.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,6 @@ public Subscription updateRchMotherSubscriber(Long msisdn, MctsMother motherUpda
410410

411411

412412
if(subscription != null){
413-
LOGGER.info("we are inside not null condition");
414-
LOGGER.info("1st value: {}",subscriberByRchId.getLastMenstrualPeriod().getDayOfYear());
415-
LOGGER.info("second value: {}",lmp.getDayOfYear());
416-
LOGGER.info("third value: {}",subscriberByRchId.getLastMenstrualPeriod().getYear());
417-
LOGGER.info("second value: {}",lmp.getYear());
418-
LOGGER.info("this is the first case: {}",(subscriberByRchId.getLastMenstrualPeriod().getDayOfYear() == lmp.getDayOfYear()));
419-
LOGGER.info("this is the second case2: {}",(subscriberByRchId.getLastMenstrualPeriod().getYear() == lmp.getYear()));
420413
if ( !((subscriberByRchId.getLastMenstrualPeriod().getDayOfYear() == lmp.getDayOfYear()) && (subscriberByRchId.getLastMenstrualPeriod().getYear() == lmp.getYear()))) {
421414
LOGGER.info("inside delete condition");
422415
subscriptionService.deleteCallRetry(subscription.getSubscriptionId());

0 commit comments

Comments
 (0)