aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-26 10:59:27 +0300
committerGravatar Vitaly Takmazov2018-03-26 10:59:27 +0300
commit7d49651b3d03b8b3f9abcee374403b9f9a8aeac1 (patch)
treeab2e9d34775fee0a46ae4e36e8e555f7d9288542
parent6108e4b2fd2dd231096d6b4512c4cdb4e56e74e7 (diff)
server: log events
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java b/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java
index 4edc9dde..63c774fa 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java
@@ -5,6 +5,8 @@ import com.juick.server.XMPPBot;
import com.juick.server.component.LikeEvent;
import com.juick.server.component.MessageEvent;
import com.juick.server.component.SubscribeEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -13,6 +15,7 @@ import javax.inject.Inject;
@Configuration
public class EventsConfiguration {
+ private static Logger logger = LoggerFactory.getLogger(EventsConfiguration.class);
@Inject
private TelegramBotManager telegramBotManager;
@Inject
@@ -20,6 +23,7 @@ public class EventsConfiguration {
@Bean
ApplicationListener<MessageEvent> messageListener() {
return event -> {
+ logger.info("MessageEvent: {}", event.getMessage());
telegramBotManager.processMessage(event.getMessage());
bot.processMessage(event.getMessage());
};
@@ -27,12 +31,14 @@ public class EventsConfiguration {
@Bean
ApplicationListener<LikeEvent> likeListener() {
return event -> {
+ logger.info("LikeEvent: {} -> {}", event.getUser().getName(), event.getMessage());
telegramBotManager.processLike(event.getUser(), event.getMessage());
};
}
@Bean
ApplicationListener<SubscribeEvent> subscribeListener() {
return event -> {
+ logger.info("SubscribeEvent: {} -> {}", event.getUser().getName(), event.getToUser().getName());
telegramBotManager.processSubscribe(event.getUser(), event.getToUser());
};
}