Skip to content

Commit

Permalink
chore: minor logging adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
extern-maksim-kuzmin1 committed Feb 26, 2024
1 parent 9821a59 commit 54064e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.whiskels.notifier.infrastructure.repository.AbstractRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -34,7 +35,7 @@ void deleteOldEntries() {
repositories.forEach(repository -> {
int deletedCount = repository.deleteByDateBefore(deleteBeforeDate);
log.info("{} Deleted {} old entries loaded before {}",
repository.getClass().getSimpleName(), deletedCount, deleteBeforeDate);
AopProxyUtils.proxiedUserInterfaces(repository)[0].getSimpleName(), deletedCount, deleteBeforeDate);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nonnull;

import java.time.Clock;
import java.util.Comparator;
import java.util.List;
Expand Down Expand Up @@ -59,7 +58,7 @@ private Payload createReport(ReportData<Employee> data, ReportContext context) {
.collect(Collectors.toList());

if (skipEmpty && birthdays.isEmpty() && anniversaries.isEmpty()) {
log.debug("Employee payload creation aborted: empty event lists and skipEmpty flag is true: {}", context.getClass().getSimpleName());
log.warn("Employee payload creation aborted: empty event lists and skipEmpty flag is true: {}", context.getClass().getSimpleName());
return null;
}

Expand Down

0 comments on commit 54064e1

Please sign in to comment.