diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java index 5cb3110..cec40f2 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java @@ -13,6 +13,8 @@ import com.google.gson.Gson; import java.io.IOException; import java.util.*; import javax.websocket.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -20,6 +22,8 @@ import org.springframework.stereotype.Component; @Component public class SensorSocketEndpoint extends Endpoint { + private static final Logger logger = LoggerFactory.getLogger(SensorSocketEndpoint.class); + private final Gson gson = GsonConfig.socketGson(); @Autowired private DevicePopulationService deviceService; @@ -98,7 +102,7 @@ public class SensorSocketEndpoint extends Endpoint { authorizedClients.remove(u, s); } } catch (IOException e) { - e.printStackTrace(); + logger.warn(e.getLocalizedMessage(), e); } } }