From 5b0f06efc28a7f578d173c1bc0d1a51b77445faa Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 4 Jul 2024 07:06:54 +0100 Subject: [PATCH] add topics to logs --- src/main/java/cc/fascinated/bat/Emojis.java | 2 +- src/main/java/cc/fascinated/bat/common/ChannelUtils.java | 2 +- src/main/java/cc/fascinated/bat/common/PasteUtils.java | 2 +- src/main/java/cc/fascinated/bat/common/SpotifyUtils.java | 2 +- src/main/java/cc/fascinated/bat/common/UserUtils.java | 2 +- .../cc/fascinated/bat/features/autorole/AutoRoleListener.java | 2 +- .../bat/features/logging/listeners/ChannelListener.java | 2 +- .../bat/features/logging/listeners/GuildListener.java | 2 +- .../bat/features/logging/listeners/MemberListener.java | 2 +- .../bat/features/logging/listeners/MessageListener.java | 2 +- .../bat/features/scoresaber/NumberOneScoreFeedListener.java | 2 +- .../bat/features/scoresaber/UserScoreFeedListener.java | 2 +- .../bat/features/spotify/command/CurrentSubCommand.java | 2 +- .../fascinated/bat/migrations/MongockSuccessEventListener.java | 3 ++- .../java/cc/fascinated/bat/service/DiscordMessageService.java | 2 +- 15 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/Emojis.java b/src/main/java/cc/fascinated/bat/Emojis.java index b66fe3d..c73602d 100644 --- a/src/main/java/cc/fascinated/bat/Emojis.java +++ b/src/main/java/cc/fascinated/bat/Emojis.java @@ -8,7 +8,7 @@ import net.dv8tion.jda.api.entities.emoji.Emoji; /** * @author Fascinated (fascinated7) */ -@Log4j2 +@Log4j2(topic = "Emojis") public class Emojis { public static final Emoji SPOTIFY_EMOJI; public static final Emoji CHECK_MARK_EMOJI; diff --git a/src/main/java/cc/fascinated/bat/common/ChannelUtils.java b/src/main/java/cc/fascinated/bat/common/ChannelUtils.java index e989fde..9cdda56 100644 --- a/src/main/java/cc/fascinated/bat/common/ChannelUtils.java +++ b/src/main/java/cc/fascinated/bat/common/ChannelUtils.java @@ -9,7 +9,7 @@ import net.dv8tion.jda.api.entities.channel.concrete.TextChannel; * @author Fascinated (fascinated7) */ @UtilityClass -@Log4j2 +@Log4j2(topic = "ChannelUtils") public class ChannelUtils { /** * Gets the user with the given id diff --git a/src/main/java/cc/fascinated/bat/common/PasteUtils.java b/src/main/java/cc/fascinated/bat/common/PasteUtils.java index 4344705..8d4ccc7 100644 --- a/src/main/java/cc/fascinated/bat/common/PasteUtils.java +++ b/src/main/java/cc/fascinated/bat/common/PasteUtils.java @@ -15,7 +15,7 @@ import java.net.http.HttpResponse; * @author Fascinated (fascinated7) */ @UtilityClass -@Log4j2 +@Log4j2(topic = "PasteUtils") public class PasteUtils { private static final String PASTE_URL = "https://paste.fascinated.cc/"; private static final String PASTE_UPLOAD_URL = PASTE_URL + "api/upload"; diff --git a/src/main/java/cc/fascinated/bat/common/SpotifyUtils.java b/src/main/java/cc/fascinated/bat/common/SpotifyUtils.java index 860f18d..5793234 100644 --- a/src/main/java/cc/fascinated/bat/common/SpotifyUtils.java +++ b/src/main/java/cc/fascinated/bat/common/SpotifyUtils.java @@ -12,7 +12,7 @@ import se.michaelthelin.spotify.model_objects.specification.Track; * @author Fascinated (fascinated7) */ @UtilityClass -@Log4j2 +@Log4j2(topic = "Spotify Utils") public class SpotifyUtils { /** * Gets the URL of the track that is currently playing. diff --git a/src/main/java/cc/fascinated/bat/common/UserUtils.java b/src/main/java/cc/fascinated/bat/common/UserUtils.java index daa0578..a37b351 100644 --- a/src/main/java/cc/fascinated/bat/common/UserUtils.java +++ b/src/main/java/cc/fascinated/bat/common/UserUtils.java @@ -9,7 +9,7 @@ import net.dv8tion.jda.api.entities.User; * @author Fascinated (fascinated7) */ @UtilityClass -@Log4j2 +@Log4j2(topic = "UserUtils") public class UserUtils { /** * Gets the user with the given id diff --git a/src/main/java/cc/fascinated/bat/features/autorole/AutoRoleListener.java b/src/main/java/cc/fascinated/bat/features/autorole/AutoRoleListener.java index eaa7dd3..158c1a0 100644 --- a/src/main/java/cc/fascinated/bat/features/autorole/AutoRoleListener.java +++ b/src/main/java/cc/fascinated/bat/features/autorole/AutoRoleListener.java @@ -19,7 +19,7 @@ import java.util.List; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "AutoRole Listener") public class AutoRoleListener implements EventListener { private final FeatureService featureService; diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java index 5aa93ce..2b7aa4b 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/ChannelListener.java @@ -34,7 +34,7 @@ import java.util.Map; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "Channel Listener") public class ChannelListener implements EventListener { /** * A map of users and the last voice channel they were in diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/GuildListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/GuildListener.java index 566d9c3..c90fa35 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/GuildListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/GuildListener.java @@ -22,7 +22,7 @@ import org.springframework.stereotype.Component; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "Guild Listener") public class GuildListener implements EventListener { private final LogFeature logFeature; diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java index 62fb9eb..56ff7e2 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/MemberListener.java @@ -36,7 +36,7 @@ import java.util.List; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "Member Listener") public class MemberListener implements EventListener { private final LogFeature logFeature; private final GuildService guildService; diff --git a/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java b/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java index c3c069e..a6a0c80 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java +++ b/src/main/java/cc/fascinated/bat/features/logging/listeners/MessageListener.java @@ -20,7 +20,7 @@ import org.springframework.stereotype.Component; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "Message Listener") public class MessageListener implements EventListener { private final LogFeature logFeature; diff --git a/src/main/java/cc/fascinated/bat/features/scoresaber/NumberOneScoreFeedListener.java b/src/main/java/cc/fascinated/bat/features/scoresaber/NumberOneScoreFeedListener.java index fb9a102..66c3ce9 100644 --- a/src/main/java/cc/fascinated/bat/features/scoresaber/NumberOneScoreFeedListener.java +++ b/src/main/java/cc/fascinated/bat/features/scoresaber/NumberOneScoreFeedListener.java @@ -22,7 +22,7 @@ import org.springframework.stereotype.Component; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "NumberOneScoreFeed Listener") public class NumberOneScoreFeedListener implements EventListener { private final GuildService guildService; private final FeatureService featureService; diff --git a/src/main/java/cc/fascinated/bat/features/scoresaber/UserScoreFeedListener.java b/src/main/java/cc/fascinated/bat/features/scoresaber/UserScoreFeedListener.java index f0b5e26..485c2b9 100644 --- a/src/main/java/cc/fascinated/bat/features/scoresaber/UserScoreFeedListener.java +++ b/src/main/java/cc/fascinated/bat/features/scoresaber/UserScoreFeedListener.java @@ -21,7 +21,7 @@ import org.springframework.stereotype.Component; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "UserScoreFeed Listener") public class UserScoreFeedListener implements EventListener { private final GuildService guildService; private final FeatureService featureService; diff --git a/src/main/java/cc/fascinated/bat/features/spotify/command/CurrentSubCommand.java b/src/main/java/cc/fascinated/bat/features/spotify/command/CurrentSubCommand.java index 69518a2..b929f09 100644 --- a/src/main/java/cc/fascinated/bat/features/spotify/command/CurrentSubCommand.java +++ b/src/main/java/cc/fascinated/bat/features/spotify/command/CurrentSubCommand.java @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit; * @author Fascinated (fascinated7) */ @Component -@Log4j2 +@Log4j2(topic = "Spotify Current Command") @CommandInfo(name = "current", description = "Gets the currently playing Spotify track") public class CurrentSubCommand extends BatSubCommand implements EventListener { private final SpotifyService spotifyService; diff --git a/src/main/java/cc/fascinated/bat/migrations/MongockSuccessEventListener.java b/src/main/java/cc/fascinated/bat/migrations/MongockSuccessEventListener.java index 6fd1dae..3f6b346 100644 --- a/src/main/java/cc/fascinated/bat/migrations/MongockSuccessEventListener.java +++ b/src/main/java/cc/fascinated/bat/migrations/MongockSuccessEventListener.java @@ -6,7 +6,8 @@ import org.jetbrains.annotations.NotNull; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; -@Component @Log4j2 +@Component +@Log4j2(topic = "Mongock Listener") public class MongockSuccessEventListener implements ApplicationListener { @Override public void onApplicationEvent(@NotNull SpringMigrationSuccessEvent event) { diff --git a/src/main/java/cc/fascinated/bat/service/DiscordMessageService.java b/src/main/java/cc/fascinated/bat/service/DiscordMessageService.java index d9ce0e6..0376c45 100644 --- a/src/main/java/cc/fascinated/bat/service/DiscordMessageService.java +++ b/src/main/java/cc/fascinated/bat/service/DiscordMessageService.java @@ -22,7 +22,7 @@ import java.util.Optional; * @author Fascinated (fascinated7) */ @Service -@Log4j2 +@Log4j2(topic = "Discord Message Service") @DependsOn("discordService") public class DiscordMessageService extends ListenerAdapter { private final DiscordMessageRepository discordMessageRepository;