From 7d49651b3d03b8b3f9abcee374403b9f9a8aeac1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 26 Mar 2018 10:59:27 +0300 Subject: server: log events --- .../java/com/juick/server/configuration/EventsConfiguration.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'juick-server/src/main/java') 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 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 likeListener() { return event -> { + logger.info("LikeEvent: {} -> {}", event.getUser().getName(), event.getMessage()); telegramBotManager.processLike(event.getUser(), event.getMessage()); }; } @Bean ApplicationListener subscribeListener() { return event -> { + logger.info("SubscribeEvent: {} -> {}", event.getUser().getName(), event.getToUser().getName()); telegramBotManager.processSubscribe(event.getUser(), event.getToUser()); }; } -- cgit v1.2.3