[AB-xx] replacing trace log with debug

This commit is contained in:
Sheldan
2021-04-04 18:23:18 +02:00
parent 19baf981f1
commit 8258197bfc
68 changed files with 241 additions and 241 deletions

View File

@@ -211,7 +211,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
for (ParameterValidator parameterValidator : parameter.getValidators()) {
boolean validate = parameterValidator.validate(parameters.getParameters().get(i));
if(!validate) {
log.trace("Parameter {} in command {} failed to validate.", parameter.getName(), foundCommand.getConfiguration().getName());
log.debug("Parameter {} in command {} failed to validate.", parameter.getName(), foundCommand.getConfiguration().getName());
throw new CommandParameterValidationException(parameterValidator.getParameters(), parameterValidator.getExceptionTemplateName(), parameter);
}
}
@@ -220,7 +220,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
@Transactional
public void executePostCommandListener(Command foundCommand, CommandContext commandContext, CommandResult result) {
log.trace("Executing post command listeners for command from message {}.", commandContext.getMessage().getIdLong());
log.debug("Executing post command listeners for command from message {}.", commandContext.getMessage().getIdLong());
for (PostCommandExecution postCommandExecution : executions) {
postCommandExecution.execute(commandContext, result, foundCommand);
}
@@ -247,7 +247,7 @@ public class CommandReceivedHandler extends ListenerAdapter {
if(command.getConfiguration().getParameters() == null || command.getConfiguration().getParameters().isEmpty()) {
return CompletableFuture.completedFuture(Parameters.builder().parameters(parsedParameters).build());
}
log.trace("Parsing parameters for command {} based on message {}.", command.getConfiguration().getName(), message.getId());
log.debug("Parsing parameters for command {} based on message {}.", command.getConfiguration().getName(), message.getId());
Iterator<TextChannel> channelIterator = message.getMentionedChannels().iterator();
Iterator<Emote> emoteIterator = message.getEmotesBag().iterator();
Iterator<Member> memberIterator = message.getMentionedMembers().iterator();

View File

@@ -22,7 +22,7 @@ public class SelfDestructPostExecution implements PostCommandExecution {
public void execute(CommandContext commandContext, CommandResult commandResult, Command command) {
if(commandResult.getResult().equals(ResultState.SELF_DESTRUCT)) {
Message message = commandContext.getMessage();
log.trace("Command {} is of type self destruct. Deleting message {} in channel {} in server {}.",
log.debug("Command {} is of type self destruct. Deleting message {} in channel {} in server {}.",
command.getConfiguration().getName(), message.getId(), message.getChannel().getId(), message.getGuild().getId());
messageService.deleteMessage(message);
}

View File

@@ -29,7 +29,7 @@ public class ChannelGroupCommandServiceBean implements ChannelGroupCommandServic
Optional<AChannel> channelInGroup = aChannelGroupCommand.getGroup()
.getChannels().stream().filter(innerChannel -> innerChannel.getId().equals(channel.getId())).findAny();
if (channelInGroup.isPresent() && !aChannelGroupCommand.getEnabled()) {
log.trace("Command {} is disabled because the channel is part of group {} in server.", command.getName(), aChannelGroupCommand.getGroup().getId());
log.debug("Command {} is disabled because the channel is part of group {} in server.", command.getName(), aChannelGroupCommand.getGroup().getId());
return false;
}
}

View File

@@ -25,7 +25,7 @@ public class ChannelGroupCommandManagementServiceBean implements ChannelGroupCom
AChannelGroupCommand groupCommand = groupCommandOptional.orElseGet(() -> createCommandInGroup(command, group));
groupCommand.setEnabled(enabled);
log.trace("Setting command {} enabled in group {} to {}.", command.getName(), group.getId(), enabled);
log.debug("Setting command {} enabled in group {} to {}.", command.getName(), group.getId(), enabled);
groupCommandRepository.save(groupCommand);
}

View File

@@ -53,7 +53,7 @@ public class PostTargetCommand extends AbstractConditionableCommand {
@Override
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
if(commandContext.getParameters().getParameters().isEmpty()) {
log.trace("Displaying existing post targets for guild {}.", commandContext.getGuild().getId());
log.debug("Displaying existing post targets for guild {}.", commandContext.getGuild().getId());
PostTargetDisplayModel posttargetDisplayModel = (PostTargetDisplayModel) ContextConverter.fromCommandContext(commandContext, PostTargetDisplayModel.class);
AServer server = serverManagementService.loadServer(commandContext.getGuild());
List<PostTarget> postTargets = postTargetService.getPostTargets(server);

View File

@@ -111,7 +111,7 @@ public class Help implements Command {
if(moduleService.moduleExists(parameter)){
metricService.incrementCounter(HELP_COMMAND_MODULE_METRIC);
ModuleDefinition moduleDefinition = moduleService.getModuleByName(parameter);
log.trace("Displaying help for module {}.", moduleDefinition.getInfo().getName());
log.debug("Displaying help for module {}.", moduleDefinition.getInfo().getName());
SingleLevelPackedModule module = moduleService.getPackedModule(moduleDefinition);
List<Command> commands = module.getCommands();
List<Command> filteredCommands = new ArrayList<>();
@@ -133,7 +133,7 @@ public class Help implements Command {
if(commandOptional.isPresent()) {
metricService.incrementCounter(HELP_COMMAND_COMMAND_METRIC);
Command command = commandOptional.get();
log.trace("Displaying help for command {}.", command.getConfiguration().getName());
log.debug("Displaying help for command {}.", command.getConfiguration().getName());
ACommand aCommand = commandManagementService.findCommandByName(command.getConfiguration().getName());
List<String> aliases = commandInServerAliasService.getAliasesForCommand(commandContext.getGuild().getIdLong(), command.getConfiguration().getName());
ACommandInAServer aCommandInAServer = commandInServerManagementService.getCommandForServer(aCommand, commandContext.getGuild().getIdLong());
@@ -158,7 +158,7 @@ public class Help implements Command {
}
private CompletableFuture<CommandResult> displayHelpOverview(CommandContext commandContext) {
log.trace("Displaying help overview response.");
log.debug("Displaying help overview response.");
ModuleDefinition moduleDefinition = moduleService.getDefaultModule();
List<ModuleDefinition> subModules = moduleService.getSubModules(moduleDefinition);
HelpModuleOverviewModel model = (HelpModuleOverviewModel) ContextConverter.fromCommandContext(commandContext, HelpModuleOverviewModel.class);

View File

@@ -15,7 +15,7 @@ public class PostTargetDelayedAction implements DelayedAction {
@Override
public void execute(DelayedActionConfig delayedActionConfig) {
PostTargetDelayedActionConfig castedConfig = (PostTargetDelayedActionConfig) delayedActionConfig;
log.trace("Executing post target delayed step to set post target {} to channel {} in server {}.", castedConfig.getPostTargetKey(), castedConfig.getChannelId(), castedConfig.getServerId());
log.debug("Executing post target delayed step to set post target {} to channel {} in server {}.", castedConfig.getPostTargetKey(), castedConfig.getChannelId(), castedConfig.getServerId());
postTargetManagement.createOrUpdate(castedConfig.getPostTargetKey(), castedConfig.getServerId(), castedConfig.getChannelId());
}

View File

@@ -72,7 +72,7 @@ public class PostTargetSetupStep extends AbstractConfigSetupStep {
CompletableFuture<SetupStepResult> future = new CompletableFuture<>();
AUserInAServer aUserInAServer = userInServerManagementService.loadOrCreateUser(user.getGuildId(), user.getUserId());
Runnable finalAction = super.getTimeoutRunnable(user.getGuildId(), user.getChannelId());
log.trace("Executing setup for post target {} in server {} for user {}.", postTargetStepParameter.getPostTargetKey(), user.getGuildId(), user.getUserId());
log.debug("Executing setup for post target {} in server {} for user {}.", postTargetStepParameter.getPostTargetKey(), user.getGuildId(), user.getUserId());
Consumer<MessageReceivedEvent> configAction = (MessageReceivedEvent event) -> {
try {
@@ -83,7 +83,7 @@ public class PostTargetSetupStep extends AbstractConfigSetupStep {
result = SetupStepResult.fromCancelled();
} else {
if(message.getMentionedChannels().size() == 0) {
log.trace("No mentioned channel was seen in channel, nothing provided.");
log.debug("No mentioned channel was seen in channel, nothing provided.");
throw new NoChannelProvidedException();
}
TextChannel textChannel = message.getMentionedChannels().get(0);
@@ -94,7 +94,7 @@ public class PostTargetSetupStep extends AbstractConfigSetupStep {
.textChannel(textChannel)
.channelId(textChannel.getIdLong())
.build();
log.trace("Setup for post target {} in server {} for user {} completed. Storing delayed action.", postTargetStepParameter.getPostTargetKey(), user.getGuildId(), user.getUserId());
log.debug("Setup for post target {} in server {} for user {} completed. Storing delayed action.", postTargetStepParameter.getPostTargetKey(), user.getGuildId(), user.getUserId());
List<DelayedActionConfig> delayedSteps = Arrays.asList(build);
result = SetupStepResult
.builder()

View File

@@ -16,7 +16,7 @@ public class SystemConfigDelayedAction implements DelayedAction {
@Override
public void execute(DelayedActionConfig delayedActionConfig) {
SystemConfigDelayedActionConfig concrete = (SystemConfigDelayedActionConfig) delayedActionConfig;
log.trace("Executing delayed system config action for key {} in server {}.", concrete.getConfigKey(), concrete.getServerId());
log.debug("Executing delayed system config action for key {} in server {}.", concrete.getConfigKey(), concrete.getServerId());
configService.setOrCreateConfigValue(concrete.getServerId(), concrete.getConfigKey(), concrete.getValue());
}

View File

@@ -62,7 +62,7 @@ public class SystemConfigSetupStep extends AbstractConfigSetupStep {
AChannel channel = channelManagementService.loadChannel(user.getChannelId());
CompletableFuture<SetupStepResult> future = new CompletableFuture<>();
AUserInAServer aUserInAServer = userInServerManagementService.loadOrCreateUser(user.getGuildId(), user.getUserId());
log.trace("Executing setup for system config {} in server {} for user {}.", systemConfigStepParameter.getConfigKey(), user.getGuildId(), user.getUserId());
log.debug("Executing setup for system config {} in server {} for user {}.", systemConfigStepParameter.getConfigKey(), user.getGuildId(), user.getUserId());
Runnable finalAction = super.getTimeoutRunnable(user.getGuildId(), user.getChannelId());
Consumer<MessageReceivedEvent> configAction = (MessageReceivedEvent event) -> {
@@ -79,7 +79,7 @@ public class SystemConfigSetupStep extends AbstractConfigSetupStep {
log.info("It was decided to keep the original value for key {} in server {}.", systemConfigStepParameter.getConfigKey(), user.getGuildId());
} else {
config = self.checkValidity(systemConfigStepParameter, event);
log.trace("The given value for key {} in server {} was valid.", systemConfigStepParameter.getConfigKey(), user.getGuildId());
log.debug("The given value for key {} in server {} was valid.", systemConfigStepParameter.getConfigKey(), user.getGuildId());
}
SystemConfigDelayedActionConfig build = SystemConfigDelayedActionConfig
.builder()
@@ -87,7 +87,7 @@ public class SystemConfigSetupStep extends AbstractConfigSetupStep {
.serverId(user.getGuildId())
.value(config)
.build();
log.trace("Setup for system config {} in server {} for user {} completed. Storing delayed action.", systemConfigStepParameter.getConfigKey(), user.getGuildId(), user.getUserId());
log.debug("Setup for system config {} in server {} for user {} completed. Storing delayed action.", systemConfigStepParameter.getConfigKey(), user.getGuildId(), user.getUserId());
List<DelayedActionConfig> delayedSteps = Arrays.asList(build);
result = SetupStepResult
.builder()

View File

@@ -69,7 +69,7 @@ public class AsyncPrivateMessageReceivedListenerBean extends ListenerAdapter {
@Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.SERIALIZABLE)
public void executeIndividualPrivateMessageReceivedListener(CachedMessage cachedMessage, AsyncPrivateMessageReceivedListener messageReceivedListener) {
log.trace("Executing private message listener {} for member {}.", messageReceivedListener.getClass().getName(), cachedMessage.getAuthor().getAuthorId());
log.debug("Executing private message listener {} for member {}.", messageReceivedListener.getClass().getName(), cachedMessage.getAuthor().getAuthorId());
messageReceivedListener.execute(cachedMessage);
}

View File

@@ -52,7 +52,7 @@ public class PrivateMessageReceivedListenerBean extends ListenerAdapter {
@Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.SERIALIZABLE)
public void executeIndividualPrivateMessageReceivedListener(@Nonnull PrivateMessageReceivedEvent event, PrivateMessageReceivedListener messageReceivedListener) {
// no feature flag check, because we are in no server context
log.trace("Executing private message listener {} for member {}.", messageReceivedListener.getClass().getName(), event.getAuthor().getId());
log.debug("Executing private message listener {} for member {}.", messageReceivedListener.getClass().getName(), event.getAuthor().getId());
messageReceivedListener.execute(event.getMessage());
}

View File

@@ -85,7 +85,7 @@ public class CacheEntityServiceBean implements CacheEntityService {
}
List<MessageEmbed.Field> fields = embed.getFields();
if(!fields.isEmpty()) {
log.trace("Caching {} fields.", fields.size());
log.debug("Caching {} fields.", fields.size());
List<CachedEmbedField> cachedEmbedFields = new ArrayList<>();
fields.forEach(field -> {
CachedEmbedField build = CachedEmbedField
@@ -159,13 +159,13 @@ public class CacheEntityServiceBean implements CacheEntityService {
List<ServerUser> aUsers = new ArrayList<>();
users.forEachAsync(user -> {
log.trace("Loading user {} for reaction.", user.getIdLong());
log.debug("Loading user {} for reaction.", user.getIdLong());
if(reaction.getGuild() != null) {
aUsers.add(ServerUser.builder().userId(user.getIdLong()).serverId(reaction.getGuild().getIdLong()).build());
}
return true;
}).whenComplete((o, throwable) -> {
log.trace("{} Users have been loaded. Completing future.", aUsers.size());
log.debug("{} Users have been loaded. Completing future.", aUsers.size());
if(throwable != null) {
log.error("Reaction user retrieval failed. Completing with what we have.", throwable);
}
@@ -181,24 +181,24 @@ public class CacheEntityServiceBean implements CacheEntityService {
public CompletableFuture<CachedMessage> buildCachedMessageFromMessage(Message message) {
CompletableFuture<CachedMessage> future = new CompletableFuture<>();
List<CachedAttachment> attachments = new ArrayList<>();
log.trace("Caching {} attachments.", message.getAttachments().size());
log.debug("Caching {} attachments.", message.getAttachments().size());
message.getAttachments().forEach(attachment ->
attachments.add(getCachedAttachment(attachment))
);
log.trace("Caching {} embeds.", message.getEmbeds().size());
log.debug("Caching {} embeds.", message.getEmbeds().size());
List<CachedEmbed> embeds = new ArrayList<>();
message.getEmbeds().forEach(embed ->
embeds.add(getCachedEmbedFromEmbed(embed))
);
log.trace("Caching {} emotes.", message.getEmbeds().size());
log.debug("Caching {} emotes.", message.getEmbeds().size());
List<CachedEmote> emotes = new ArrayList<>();
if(message.isFromGuild()) {
message.getEmotesBag().forEach(emote -> emotes.add(getCachedEmoteFromEmote(emote, message.getGuild())));
}
List<CompletableFuture<CachedReactions>> futures = new ArrayList<>();
log.trace("Caching {} reactions.", message.getReactions().size());
log.debug("Caching {} reactions.", message.getReactions().size());
message.getReactions().forEach(messageReaction -> futures.add(getCachedReactionFromReaction(messageReaction)));
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).thenAccept(aVoid ->
{

View File

@@ -123,7 +123,7 @@ public class ChannelServiceBean implements ChannelService {
@Override
public CompletableFuture<Message> sendMessageToChannel(Message message, MessageChannel channel) {
log.trace("Sending message {} from channel {} and server {} to channel {}.",
log.debug("Sending message {} from channel {} and server {} to channel {}.",
message.getId(), message.getChannel().getId(), message.getGuild().getId(), channel.getId());
metricService.incrementCounter(MESSAGE_SEND_METRIC);
return channel.sendMessage(message).allowedMentions(getAllowedMentionsFor(channel)).submit();
@@ -138,7 +138,7 @@ public class ChannelServiceBean implements ChannelService {
@Override
public CompletableFuture<Message> sendTextToChannel(String text, MessageChannel channel) {
log.trace("Sending text to channel {}.", channel.getId());
log.debug("Sending text to channel {}.", channel.getId());
metricService.incrementCounter(MESSAGE_SEND_METRIC);
return channel.sendMessage(text).allowedMentions(getAllowedMentionsFor(channel)).submit();
}
@@ -162,7 +162,7 @@ public class ChannelServiceBean implements ChannelService {
@Override
public CompletableFuture<Message> sendEmbedToChannel(MessageEmbed embed, MessageChannel channel) {
log.trace("Sending embed to channel {}.", channel.getId());
log.debug("Sending embed to channel {}.", channel.getId());
return sendEmbedToChannelInComplete(embed, channel).submit();
}
@@ -259,14 +259,14 @@ public class ChannelServiceBean implements ChannelService {
public CompletableFuture<Message> editMessageInAChannelFuture(MessageToSend messageToSend, MessageChannel channel, Long messageId) {
MessageAction messageAction;
if(!StringUtils.isBlank(messageToSend.getMessages().get(0))) {
log.trace("Editing message {} with new text content.", messageId);
log.debug("Editing message {} with new text content.", messageId);
messageAction = channel.editMessageById(messageId, messageToSend.getMessages().get(0));
if(messageToSend.getEmbeds() != null && !messageToSend.getEmbeds().isEmpty()) {
log.trace("Also editing the embed for message {}.", messageId);
log.debug("Also editing the embed for message {}.", messageId);
messageAction = messageAction.embed(messageToSend.getEmbeds().get(0));
}
} else {
log.trace("Editing message {} with new embeds.", messageId);
log.debug("Editing message {} with new embeds.", messageId);
if(messageToSend.getEmbeds() != null && !messageToSend.getEmbeds().isEmpty()) {
messageAction = channel.editMessageById(messageId, messageToSend.getEmbeds().get(0));
} else {
@@ -316,7 +316,7 @@ public class ChannelServiceBean implements ChannelService {
return retrieveMessageInChannel(channel, messageId).thenCompose(message -> {
EmbedBuilder embedBuilder = new EmbedBuilder(message.getEmbeds().get(embedIndex));
embedBuilder.getFields().remove(index.intValue());
log.trace("Removing field with index {} from message {}.", index, messageId);
log.debug("Removing field with index {} from message {}.", index, messageId);
return editEmbedMessageInAChannel(embedBuilder.build(), channel, messageId);
});
}

View File

@@ -27,11 +27,11 @@ public class ConditionServiceBean implements ConditionService {
.stream()
.filter(systemCondition -> systemCondition.getConditionName().equalsIgnoreCase(context.getConditionName()))
.findAny();
log.trace("Checking condition {}.", context.getConditionName());
log.debug("Checking condition {}.", context.getConditionName());
return matchingCondition.map(systemCondition -> {
verifyConditionContext(context, systemCondition);
boolean result = systemCondition.checkCondition(context);
log.trace("Condition resulted in {}.", result);
log.debug("Condition resulted in {}.", result);
return result;
}).orElse(true);
}

View File

@@ -15,7 +15,7 @@ public class CounterServiceBean implements CounterService {
@Override
public Long getNextCounterValue(AServer server, String key) {
log.trace("Retrieving new counter value for key {} in server {}.", key, server.getId());
log.debug("Retrieving new counter value for key {} in server {}.", key, server.getId());
return counterRepository.getNewCounterForKey(server.getId(), key);
}
}

View File

@@ -18,7 +18,7 @@ public class DelayedActionServiceBean implements DelayedActionService {
@Override
public void executeDelayedActions(List<DelayedActionConfig> delayedActionConfigList) {
delayedActionConfigList.forEach(delayedActionConfig -> {
log.trace("Executing delayed action {}.", delayedActionConfig.getClass().getSimpleName());
log.debug("Executing delayed action {}.", delayedActionConfig.getClass().getSimpleName());
delayedActions.stream()
.filter(delayedAction -> delayedAction.handles(delayedActionConfig))
.findFirst()

View File

@@ -105,19 +105,19 @@ public class FeatureConfigServiceBean implements FeatureConfigService {
log.info("Verifying feature setup for feature {} in server {}.", featureConfig.getFeature().getKey(), server.getId());
FeatureValidationResult featureValidationResult = FeatureValidationResult.validationSuccessful(featureConfig);
featureConfig.getRequiredPostTargets().forEach(s -> {
log.trace("Checking post target {}.", s.getKey());
log.debug("Checking post target {}.", s.getKey());
featureValidatorService.checkPostTarget(s, server, featureValidationResult);
});
featureConfig.getRequiredSystemConfigKeys().forEach(s -> {
log.trace("Checking system config key {}.", s);
log.debug("Checking system config key {}.", s);
featureValidatorService.checkSystemConfig(s, server, featureValidationResult);
});
featureConfig.getRequiredEmotes().forEach(s -> {
log.trace("Checking required emote {}.", s);
log.debug("Checking required emote {}.", s);
featureValidatorService.checkEmote(s, server, featureValidationResult);
} );
featureConfig.getAdditionalFeatureValidators().forEach(featureValidator -> {
log.trace("Executing additional feature validator {}.", featureValidator.getClass().getName());
log.debug("Executing additional feature validator {}.", featureValidator.getClass().getName());
featureValidator.featureIsSetup(featureConfig, server, featureValidationResult);
});
return featureValidationResult;

View File

@@ -65,7 +65,7 @@ public class FeatureSetupServiceBean implements FeatureSetupService {
List<String> requiredSystemConfigKeys = featureConfig.getRequiredSystemConfigKeys();
List<SetupExecution> steps = new ArrayList<>();
requiredSystemConfigKeys.forEach(s -> {
log.trace("Feature requires system config key {}.", s);
log.debug("Feature requires system config key {}.", s);
SetupExecution execution = SetupExecution
.builder()
.step(systemConfigSetupStep)
@@ -74,7 +74,7 @@ public class FeatureSetupServiceBean implements FeatureSetupService {
steps.add(execution);
});
featureConfig.getRequiredPostTargets().forEach(postTargetEnum -> {
log.trace("Feature requires post target {}.", postTargetEnum.getKey());
log.debug("Feature requires post target {}.", postTargetEnum.getKey());
SetupExecution execution = SetupExecution
.builder()
.step(postTargetSetupStep)
@@ -83,7 +83,7 @@ public class FeatureSetupServiceBean implements FeatureSetupService {
steps.add(execution);
});
featureConfig.getCustomSetupSteps().forEach(setupStep -> {
log.trace("Feature requires custom setup step {}.", setupStep.getClass().getName());
log.debug("Feature requires custom setup step {}.", setupStep.getClass().getName());
SetupExecution execution = SetupExecution
.builder()
.step(setupStep)
@@ -118,16 +118,16 @@ public class FeatureSetupServiceBean implements FeatureSetupService {
}
private CompletableFuture<Void> executeStep(AServerChannelUserId aUserInAServer, SetupExecution execution, List<DelayedActionConfig> delayedActionConfigs, FeatureConfig featureConfig) {
log.trace("Executing step {} in server {} in channel {} for user {}.", execution.getStep().getClass(), aUserInAServer.getGuildId(), aUserInAServer.getChannelId(), aUserInAServer.getUserId());
log.debug("Executing step {} in server {} in channel {} for user {}.", execution.getStep().getClass(), aUserInAServer.getGuildId(), aUserInAServer.getChannelId(), aUserInAServer.getUserId());
return execution.getStep().execute(aUserInAServer, execution.getParameter()).thenAccept(aVoid -> {
if(aVoid.getResult().equals(SetupStepResultType.SUCCESS)) {
log.info("Step {} in server {} has been executed successfully. Proceeding.", execution.getStep().getClass(), aUserInAServer.getGuildId());
delayedActionConfigs.addAll(aVoid.getDelayedActionConfigList());
if(execution.getNextStep() != null) {
log.trace("Executing next step {}.", execution.getNextStep().getStep().getClass());
log.debug("Executing next step {}.", execution.getNextStep().getStep().getClass());
executeStep(aUserInAServer, execution.getNextStep(), delayedActionConfigs, featureConfig);
} else {
log.trace("Step was the last step. Executing post setup steps.");
log.debug("Step was the last step. Executing post setup steps.");
self.executePostSetupSteps(delayedActionConfigs, aUserInAServer, execution.getParameter().getPreviousMessageId(), featureConfig);
}
} else {
@@ -165,7 +165,7 @@ public class FeatureSetupServiceBean implements FeatureSetupService {
@Transactional
public void notifyAboutCompletion(AServerChannelUserId aServerChannelUserId, FeatureConfig featureConfig, SetupStepResult result) {
log.trace("Notifying user {} in channel {} in server {} about completion of setup for feature {}.",
log.debug("Notifying user {} in channel {} in server {} about completion of setup for feature {}.",
aServerChannelUserId.getUserId(), aServerChannelUserId.getChannelId(), aServerChannelUserId.getGuildId(), featureConfig.getFeature().getKey());
String templateKey;
if(result.getResult().equals(SetupStepResultType.CANCELLED)) {
@@ -188,7 +188,7 @@ public class FeatureSetupServiceBean implements FeatureSetupService {
@Transactional
public void notifyAboutCancellation(AServerChannelUserId aServerChannelUserId, FeatureConfig featureConfig) {
log.trace("Notifying user {} in channel {} in server {} about cancellation of setup for feature {}.",
log.debug("Notifying user {} in channel {} in server {} about cancellation of setup for feature {}.",
aServerChannelUserId.getUserId(), aServerChannelUserId.getChannelId(), aServerChannelUserId.getGuildId(), featureConfig.getFeature().getKey());
notifyUserWithTemplate(aServerChannelUserId, featureConfig, FEATURE_SETUP_CANCELLATION_NOTIFICATION_TEMPLATE);
}

View File

@@ -33,7 +33,7 @@ public class MemberServiceBean implements MemberService {
@Override
public GuildChannelMember getServerChannelUser(Long serverId, Long channelId, Long userId) {
log.trace("Trying to retrieve member {}, channel {} in server {} from cache.", userId, channelId, serverId);
log.debug("Trying to retrieve member {}, channel {} in server {} from cache.", userId, channelId, serverId);
Guild guild = guildService.getGuildById(serverId);
Optional<TextChannel> textChannelOptional = channelService.getTextChannelFromServerOptional(guild, channelId);
if(textChannelOptional.isPresent()) {
@@ -47,7 +47,7 @@ public class MemberServiceBean implements MemberService {
@Override
public CompletableFuture<GuildChannelMember> getServerChannelUserAsync(Long serverId, Long channelId, Long userId) {
log.trace("Trying to retrieve member {}, channel {} in server {} async.", userId, channelId, serverId);
log.debug("Trying to retrieve member {}, channel {} in server {} async.", userId, channelId, serverId);
CompletableFuture<Member> memberFuture = getMemberInServerAsync(serverId, userId);
Guild guild = guildService.getGuildById(serverId);
@@ -59,7 +59,7 @@ public class MemberServiceBean implements MemberService {
@Override
public Member getMemberInServer(Long serverId, Long memberId) {
log.trace("Retrieving member {} in server {} from cache.", memberId, serverId);
log.debug("Retrieving member {} in server {} from cache.", memberId, serverId);
Guild guildById = guildService.getGuildById(serverId);
if(guildById != null) {
return guildById.getMemberById(memberId);
@@ -70,7 +70,7 @@ public class MemberServiceBean implements MemberService {
@Override
public CompletableFuture<Member> getMemberInServerAsync(Long serverId, Long memberId) {
log.trace("Retrieving member {} in server {} from cache.", memberId, serverId);
log.debug("Retrieving member {} in server {} from cache.", memberId, serverId);
Guild guildById = guildService.getGuildById(serverId);
if(guildById != null) {
return guildById.retrieveMemberById(memberId).submit();

View File

@@ -42,7 +42,7 @@ public class MessageCacheBean implements MessageCache {
@Override
@CachePut(key = "#message.id")
public CompletableFuture<CachedMessage> putMessageInCache(Message message) {
log.info("Adding message {} to cache.", message.getId());
log.debug("Adding message {} to cache.", message.getId());
return cacheEntityService.buildCachedMessageFromMessage(message);
}
@@ -50,27 +50,27 @@ public class MessageCacheBean implements MessageCache {
@Override
@CachePut(key = "#message.messageId.toString()")
public CompletableFuture<CachedMessage> putMessageInCache(CachedMessage message) {
log.info("Adding cached message {} to cache.", message.getMessageId());
log.debug("Adding cached message {} to cache.", message.getMessageId());
return CompletableFuture.completedFuture(message);
}
@Override
@Cacheable(key = "#message.id")
public CompletableFuture<CachedMessage> getMessageFromCache(Message message) {
log.trace("Retrieving message {}.", message.getId());
log.debug("Retrieving message {}.", message.getId());
return getMessageFromCache(message.getGuild().getIdLong(), message.getChannel().getIdLong(), message.getIdLong());
}
@Override
@Cacheable(key = "#messageId.toString()")
public CompletableFuture<CachedMessage> getMessageFromCache(Long guildId, Long textChannelId, Long messageId) {
log.info("Retrieving message {}.", messageId);
log.debug("Retrieving message {}.", messageId);
return concreteSelf.loadMessage(guildId, textChannelId, messageId);
}
@Override
public CompletableFuture<CachedMessage> loadMessage(Long guildId, Long textChannelId, Long messageId) {
log.info("Loading message {} from channel {} in server {}.", messageId, textChannelId, guildId);
log.debug("Loading message {} from channel {} in server {}.", messageId, textChannelId, guildId);
CompletableFuture<CachedMessage> future = new CompletableFuture<>();
Optional<Guild> guildOptional = guildService.getGuildByIdOptional(guildId);
if(guildOptional.isPresent()) {

View File

@@ -129,7 +129,7 @@ public class MessageServiceBean implements MessageService {
@Override
public CompletableFuture<Message> sendEmbedToUserWithMessage(User user, String template, Object model) {
log.trace("Sending direct message with template {} to user {}.", template, user.getIdLong());
log.debug("Sending direct message with template {} to user {}.", template, user.getIdLong());
return openPrivateChannelForUser(user).thenCompose(privateChannel ->
channelService.sendEmbedTemplateInMessageChannelList(template, model, privateChannel).get(0));
}
@@ -141,7 +141,7 @@ public class MessageServiceBean implements MessageService {
@Override
public CompletableFuture<Message> sendMessageToUser(User user, String text) {
log.trace("Sending direct string message to user {}.", user.getIdLong());
log.debug("Sending direct string message to user {}.", user.getIdLong());
return user.openPrivateChannel().flatMap(privateChannel -> privateChannel.sendMessage(text)).submit();
}

View File

@@ -53,14 +53,14 @@ public class PostTargetServiceBean implements PostTargetService {
@Override
public CompletableFuture<Message> sendTextInPostTarget(String text, PostTarget target) {
log.trace("Sending text to post target {}.", target.getName());
log.debug("Sending text to post target {}.", target.getName());
return channelService.sendTextToAChannel(text, target.getChannelReference());
}
@Override
public CompletableFuture<Message> sendEmbedInPostTarget(MessageEmbed embed, PostTarget target) {
TextChannel textChannelForPostTarget = getTextChannelForPostTarget(target);
log.trace("Sending message embed to post target {}.", target.getName());
log.debug("Sending message embed to post target {}.", target.getName());
return channelService.sendEmbedToChannel(embed, textChannelForPostTarget);
}
@@ -110,7 +110,7 @@ public class PostTargetServiceBean implements PostTargetService {
@Override
public CompletableFuture<Message> sendMessageInPostTarget(Message message, PostTarget target) {
log.trace("Send message {} towards post target {}.", message.getId(), target.getName());
log.debug("Send message {} towards post target {}.", message.getId(), target.getName());
return channelService.sendMessageToAChannel(message, target.getChannelReference());
}
@@ -123,7 +123,7 @@ public class PostTargetServiceBean implements PostTargetService {
@Override
public List<CompletableFuture<Message>> sendEmbedInPostTarget(MessageToSend message, PostTarget target) {
TextChannel textChannelForPostTarget = getTextChannelForPostTarget(target);
log.trace("Send messageToSend towards post target {}.", target.getName());
log.debug("Send messageToSend towards post target {}.", target.getName());
return channelService.sendMessageToSendToChannel(message, textChannelForPostTarget);
}
@@ -133,10 +133,10 @@ public class PostTargetServiceBean implements PostTargetService {
// always takes the first one, only applicable for this scenario
String messageText = message.getMessages().get(0);
if(StringUtils.isBlank(messageText)) {
log.trace("Editing embeds of message {} in post target {}.", messageId, target.getName());
log.debug("Editing embeds of message {} in post target {}.", messageId, target.getName());
return Arrays.asList(channelService.editEmbedMessageInAChannel(message.getEmbeds().get(0), textChannelForPostTarget, messageId));
} else {
log.trace("Editing message text and potentially text for message {} in post target {}.", messageId, target.getName());
log.debug("Editing message text and potentially text for message {} in post target {}.", messageId, target.getName());
return Arrays.asList(channelService.editTextMessageInAChannel(messageText, message.getEmbeds().get(0), textChannelForPostTarget, messageId));
}
}
@@ -149,12 +149,12 @@ public class PostTargetServiceBean implements PostTargetService {
futures.add(messageEditFuture);
if(StringUtils.isBlank(messageToSend.getMessages().get(0).trim())) {
channelService.retrieveMessageInChannel(textChannelForPostTarget, messageId).thenAccept(message -> {
log.trace("Editing existing message {} when upserting message embeds in channel {} in server {}.",
log.debug("Editing existing message {} when upserting message embeds in channel {} in server {}.",
messageId, textChannelForPostTarget.getIdLong(), textChannelForPostTarget.getGuild().getId());
messageService.editMessage(message, messageToSend.getEmbeds().get(0))
.queue(messageEditFuture::complete, messageEditFuture::completeExceptionally);
}).exceptionally(throwable -> {
log.trace("Creating new message when upserting message embeds for message {} in channel {} in server {}.",
log.debug("Creating new message when upserting message embeds for message {} in channel {} in server {}.",
messageId, textChannelForPostTarget.getIdLong(), textChannelForPostTarget.getGuild().getId());
sendEmbedInPostTarget(messageToSend, target).get(0)
.thenAccept(messageEditFuture::complete).exceptionally(innerThrowable -> {
@@ -166,12 +166,12 @@ public class PostTargetServiceBean implements PostTargetService {
});
} else {
channelService.retrieveMessageInChannel(textChannelForPostTarget, messageId).thenAccept(message -> {
log.trace("Editing existing message {} when upserting message in channel {} in server {}.",
log.debug("Editing existing message {} when upserting message in channel {} in server {}.",
messageId, textChannelForPostTarget.getIdLong(), textChannelForPostTarget.getGuild().getId());
messageService.editMessage(message, messageToSend.getMessages().get(0), messageToSend.getEmbeds().get(0))
.queue(messageEditFuture::complete, messageEditFuture::completeExceptionally);
}).exceptionally(throwable -> {
log.trace("Creating new message when trying to upsert a message {} in channel {} in server {}.",
log.debug("Creating new message when trying to upsert a message {} in channel {} in server {}.",
messageId, textChannelForPostTarget.getIdLong(), textChannelForPostTarget.getGuild().getId());
sendEmbedInPostTarget(messageToSend, target).get(0)
.thenAccept(messageEditFuture::complete).exceptionally(innerThrowable -> {

View File

@@ -43,7 +43,7 @@ public class ProfanityServiceBean implements ProfanityService {
public String replaceProfanities(String input, Long serverId, String replacement) {
if(regex.containsKey(serverId)) {
List<PatternReplacement> regexes = regex.get(serverId);
log.trace("Checking {} regexes for server {} with static replacement.", regexes.size(), serverId);
log.debug("Checking {} regexes for server {} with static replacement.", regexes.size(), serverId);
for (PatternReplacement pattern: regexes) {
Matcher matcher = pattern.getPattern().matcher(input);
input = matcher.replaceAll(replacement);
@@ -56,7 +56,7 @@ public class ProfanityServiceBean implements ProfanityService {
public String replaceProfanitiesWithDefault(String input, Long serverId, String defaultReplacement) {
if(regex.containsKey(serverId)) {
List<PatternReplacement> regexes = regex.get(serverId);
log.trace("Checking {} regexes for server {} with dynamic replacement.", regexes.size(), serverId);
log.debug("Checking {} regexes for server {} with dynamic replacement.", regexes.size(), serverId);
for (PatternReplacement pattern: regexes) {
Matcher matcher = pattern.getPattern().matcher(input);
String replacement = pattern.getReplacement() != null ? pattern.getReplacement() : defaultReplacement;
@@ -70,7 +70,7 @@ public class ProfanityServiceBean implements ProfanityService {
public boolean containsProfanity(String input, Long serverId) {
if(regex.containsKey(serverId)) {
List<PatternReplacement> regexes = regex.get(serverId);
log.trace("Checking existence of {} regexes for server {}.", regexes.size(), serverId);
log.debug("Checking existence of {} regexes for server {}.", regexes.size(), serverId);
for (PatternReplacement pattern: regexes) {
Matcher matcher = pattern.getPattern().matcher(input);
if(matcher.matches()) {

View File

@@ -152,14 +152,14 @@ public class ReactionServiceBean implements ReactionService {
if(Boolean.TRUE.equals(emote.getCustom())) {
Emote emoteById = botService.getInstance().getEmoteById(emote.getEmoteId());
if(emoteById != null) {
log.trace("Adding custom emote {} as reaction to message {}.", emoteById.getId(), message.getId());
log.debug("Adding custom emote {} as reaction to message {}.", emoteById.getId(), message.getId());
return addReactionToMessageAsync(emoteById, message);
} else {
log.error("Emote with key {} and id {} for guild {} was not found.", emote.getName() , emote.getEmoteId(), guild.getId());
throw new ConfiguredEmoteNotUsableException(emote);
}
} else {
log.trace("Adding default emote {} as reaction to message {}.", emote.getEmoteKey(), message.getId());
log.debug("Adding default emote {} as reaction to message {}.", emote.getEmoteKey(), message.getId());
return addDefaultReactionToMessageAsync(emote.getEmoteKey(), message);
}
}
@@ -192,10 +192,10 @@ public class ReactionServiceBean implements ReactionService {
if(emoteById == null) {
throw new EmoteNotInServerException(emote.getEmoteId());
}
log.trace("Removing single custom reaction for emote {} on message {}.", emoteById.getId(), message.getId());
log.debug("Removing single custom reaction for emote {} on message {}.", emoteById.getId(), message.getId());
return removeReaction(message, emoteById);
} else {
log.trace("Removing single default emote {} reaction from message {}.", emote.getEmoteKey(), message.getId());
log.debug("Removing single default emote {} reaction from message {}.", emote.getEmoteKey(), message.getId());
return removeReaction(message, emote.getEmoteKey());
}
}
@@ -265,10 +265,10 @@ public class ReactionServiceBean implements ReactionService {
if(emoteById == null) {
throw new EmoteNotInServerException(emote.getEmoteId());
}
log.trace("Clearing reactions for custom emote {} on message {}.", emoteById.getId(), message.getId());
log.debug("Clearing reactions for custom emote {} on message {}.", emoteById.getId(), message.getId());
return clearReaction(message, emoteById);
} else {
log.trace("Clearing reactions for default emote {} on message {}.", emote.getEmoteKey(), message.getId());
log.debug("Clearing reactions for default emote {} on message {}.", emote.getEmoteKey(), message.getId());
return clearReaction(message, emote.getEmoteKey());
}
}
@@ -330,10 +330,10 @@ public class ReactionServiceBean implements ReactionService {
if(emoteById == null) {
throw new EmoteNotInServerException(emote.getEmoteId());
}
log.trace("Removing reaction for custom emote {} from user {} on message {}.", emoteById.getId(), member.getId(), member.getId());
log.debug("Removing reaction for custom emote {} from user {} on message {}.", emoteById.getId(), member.getId(), member.getId());
return removeReaction(message, emoteById, member.getUser());
} else {
log.trace("Removing reaction for default emote {} from user {} on message {}.", emote.getEmoteKey(), member.getId(), member.getId());
log.debug("Removing reaction for default emote {} from user {} on message {}.", emote.getEmoteKey(), member.getId(), member.getId());
return removeReaction(message, emote.getEmoteKey(), member.getUser());
}
}

View File

@@ -204,7 +204,7 @@ public class RoleServiceBean implements RoleService {
}
Optional<Guild> guildById = guildService.getGuildByIdOptional(role.getServer().getId());
if(guildById.isPresent()) {
log.trace("Loading role {} from server {}.", role.getId(), role.getServer().getId());
log.debug("Loading role {} from server {}.", role.getId(), role.getServer().getId());
return guildById.get().getRoleById(role.getId());
} else {
throw new GuildNotFoundException(role.getServer().getId());

View File

@@ -59,7 +59,7 @@ public class ConfigManagementServiceBean implements ConfigManagementService {
.server(server)
.name(name)
.build();
log.trace("Creating config entry for type string in server {} and key {}", serverId, name);
log.debug("Creating config entry for type string in server {} and key {}", serverId, name);
return configRepository.save(config);
}
@@ -72,7 +72,7 @@ public class ConfigManagementServiceBean implements ConfigManagementService {
.server(server)
.name(name)
.build();
log.trace("Creating config entry for type double in server {} and key {}", serverId, name);
log.debug("Creating config entry for type double in server {} and key {}", serverId, name);
return configRepository.save(config);
}
@@ -85,7 +85,7 @@ public class ConfigManagementServiceBean implements ConfigManagementService {
.server(server)
.name(name)
.build();
log.trace("Creating config entry for type long in server {} and key {}", serverId, name);
log.debug("Creating config entry for type long in server {} and key {}", serverId, name);
return configRepository.save(config);
}
@@ -135,7 +135,7 @@ public class ConfigManagementServiceBean implements ConfigManagementService {
public AConfig setDoubleValue(Long serverId, String name, Double value) {
AConfig config = loadConfig(serverId, name);
config.setDoubleValue(value);
log.trace("Setting double value of key {} in server {}.", name, serverId);
log.debug("Setting double value of key {} in server {}.", name, serverId);
return config;
}
@@ -143,7 +143,7 @@ public class ConfigManagementServiceBean implements ConfigManagementService {
public AConfig setLongValue(Long serverId, String name, Long value) {
AConfig config = loadConfig(serverId, name);
config.setLongValue(value);
log.trace("Setting long value of key {} in server {}.", name, serverId);
log.debug("Setting long value of key {} in server {}.", name, serverId);
return config;
}
@@ -151,7 +151,7 @@ public class ConfigManagementServiceBean implements ConfigManagementService {
public AConfig setStringValue(Long serverId, String name, String value) {
AConfig config = loadConfig(serverId, name);
config.setStringValue(value);
log.trace("Setting string value of key {} in server {}.", name, serverId);
log.debug("Setting string value of key {} in server {}.", name, serverId);
return config;
}

View File

@@ -115,7 +115,7 @@ public class EmoteManagementServiceBean implements EmoteManagementService {
emote = this.createCustomEmote(name, emoteKey, emoteId, animated, server, true);
} else {
emote = emoteOptional.get();
log.trace("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new custom emote configuration: new id {}, animated {}.",
log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new custom emote configuration: new id {}, animated {}.",
emote.getAnimated(), emote.getCustom(), emote.getId(), emote.getEmoteId(), emoteId, animated);
emote.setEmoteKey(emoteKey);
emote.setEmoteId(emoteId);
@@ -140,7 +140,7 @@ public class EmoteManagementServiceBean implements EmoteManagementService {
emoteBeingSet = this.createDefaultEmote(name, emoteKey, server, true);
} else {
emoteBeingSet = emoteOptional.get();
log.trace("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new default emote {}.",
log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new default emote {}.",
emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), emoteKey);
emoteBeingSet.setEmoteKey(emoteKey);
emoteBeingSet.setCustom(false);
@@ -158,13 +158,13 @@ public class EmoteManagementServiceBean implements EmoteManagementService {
} else {
AEmote emoteBeingSet = emoteOptional.get();
if(fakeEmote.getCustom()) {
log.trace("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new custom emote configuration: new id {}, animated {}.",
log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new custom emote configuration: new id {}, animated {}.",
emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), fakeEmote.getEmoteId(), fakeEmote.getAnimated());
emoteBeingSet.setCustom(fakeEmote.getCustom());
emoteBeingSet.setEmoteId(fakeEmote.getEmoteId());
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey());
} else {
log.trace("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new default emote {}.",
log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new default emote {}.",
emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), fakeEmote.getEmoteKey());
emoteBeingSet.setCustom(false);
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey());