[AB-xxx] minor logging updates

This commit is contained in:
Sheldan
2021-04-24 19:54:30 +02:00
parent 40eb516ddf
commit eb79522843
6 changed files with 22 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ public class JoinLogger implements AsyncJoinListener {
.builder()
.member(listenerModel.getMember())
.build();
log.debug("Logging join event for user {} in server {}.", listenerModel.getMember().getIdLong(), listenerModel.getServerId());
MessageToSend messageToSend = templateService.renderEmbedTemplate(USER_JOIN_TEMPLATE, model, listenerModel.getServerId());
postTargetService.sendEmbedInPostTarget(messageToSend, LoggingPostTarget.JOIN_LOG, listenerModel.getServerId());
return DefaultListenerResult.PROCESSED;

View File

@@ -44,6 +44,7 @@ public class LeaveLogger implements AsyncLeaveListener {
.builder()
.user(listenerModel.getUser())
.build();
log.debug("Logging leave event for user {} in server {}.", listenerModel.getUser().getIdLong(), listenerModel.getServerId());
MessageToSend messageToSend = templateService.renderEmbedTemplate(USER_LEAVE_TEMPLATE, model, listenerModel.getServerId());
postTargetService.sendEmbedInPostTarget(messageToSend, LoggingPostTarget.LEAVE_LOG, listenerModel.getServerId());
return DefaultListenerResult.PROCESSED;

View File

@@ -73,7 +73,7 @@ public class MessageEditedListener implements AsyncMessageUpdatedListener {
List<CachedAttachment> removedAttachments = messageBefore.getAttachments().stream().filter(cachedAttachment ->
messageAfter.getAttachments().stream().noneMatch(attachment -> attachment.getIdLong() == cachedAttachment.getId())
).collect(Collectors.toList());
log.info("Logging deletion of {} attachments.", removedAttachments.size());
log.debug("Logging deletion of {} attachments.", removedAttachments.size());
for (int i = 0; i < removedAttachments.size(); i++) {
MessageDeletedAttachmentLog log = MessageDeletedAttachmentLog
.builder()