Skip to content

Commit

Permalink
Only log difference header with differences
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Mar 13, 2024
1 parent 584e3b5 commit 62cd598
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ public class DifferenceLogger {
* @param target the updated PassEntity state
*/
public void log(PassEntity source, PassEntity target) {
LOG.info("Updated " + source.getClass().getSimpleName() + " with ID: " + source.getId());
if (LOG.isInfoEnabled()) {
List<String> diffs = getDifference(source, target, source.getId());
if (!diffs.isEmpty()) {
LOG.info("Updated " + source.getClass().getSimpleName() + " with ID: " + source.getId());
}
diffs.forEach(LOG::info);
}
}
Expand Down

0 comments on commit 62cd598

Please sign in to comment.