Skip to content

Commit

Permalink
chore: prevent null message logging + log cleanup [DHIS2-17998] (#19800)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbee committed Jan 29, 2025
1 parent 83a66bd commit d5533d2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,18 @@ private void asyncPushToStore(UID job, Notification n) {
}
}
list.add(n);
NotificationLoggerUtil.log(log, n.getLevel(), n.getMessage());
logNotificationAdded(n);
}

private static void logNotificationAdded(Notification n) {
String message = n.getMessage();
if (message == null || message.isEmpty()) return;
switch (n.getLevel()) {
case LOOP, DEBUG -> log.debug(message);
case INFO -> log.info(message);
case WARN -> log.warn(message);
case ERROR -> log.error(message);
}
}

private void asyncAutomaticCleanup() {
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit d5533d2

Please sign in to comment.