|
15 | 15 | */ |
16 | 16 | package net.killarexe.dimensional_expansion.client.integration.discord; |
17 | 17 |
|
18 | | -import org.slf4j.Logger; |
19 | | -import org.slf4j.LoggerFactory; |
20 | | - |
21 | 18 | import com.google.gson.JsonObject; |
22 | 19 |
|
23 | 20 | import net.killarexe.dimensional_expansion.client.integration.discord.entities.Callback; |
|
37 | 34 |
|
38 | 35 | import javax.json.JsonException; |
39 | 36 |
|
| 37 | +import org.apache.logging.log4j.LogManager; |
| 38 | +import org.apache.logging.log4j.Logger; |
| 39 | + |
40 | 40 | /** |
41 | 41 | * Represents a Discord IPC Client that can send and receive |
42 | 42 | * Rich Presence data.<p> |
|
62 | 62 | */ |
63 | 63 | public final class IPCClient implements Closeable |
64 | 64 | { |
65 | | - private static final Logger LOGGER = LoggerFactory.getLogger(IPCClient.class); |
| 65 | + private static final Logger LOGGER = LogManager.getLogger(); |
66 | 66 | private final long clientId; |
67 | 67 | private final HashMap<String,Callback> callbacks = new HashMap<>(); |
68 | 68 | private volatile Pipe pipe; |
@@ -122,7 +122,7 @@ public void connect(DiscordBuild... preferredOrder) throws NoDiscordClientExcept |
122 | 122 |
|
123 | 123 | pipe = Pipe.openPipe(this, clientId, callbacks, preferredOrder); |
124 | 124 |
|
125 | | - LOGGER.debug("Client is now connected and ready!"); |
| 125 | + LOGGER.info("Client is now connected and ready!"); |
126 | 126 | if(listener != null) |
127 | 127 | listener.onReady(this); |
128 | 128 | startReading(); |
@@ -177,7 +177,7 @@ public void sendRichPresence(RichPresence presence, Callback callback, boolean l |
177 | 177 | { |
178 | 178 | checkConnected(true); |
179 | 179 | if(log) { |
180 | | - LOGGER.debug("Sending RichPresence to discord: "+(presence == null ? null : presence.toJson().toString())); |
| 180 | + LOGGER.info("Sending RichPresence to discord: "+(presence == null ? null : presence.toJson().toString())); |
181 | 181 | } |
182 | 182 | JsonObject command = new JsonObject(); |
183 | 183 | JsonObject args = new JsonObject(); |
@@ -230,7 +230,7 @@ public void subscribe(Event sub, Callback callback) |
230 | 230 | checkConnected(true); |
231 | 231 | if(!sub.isSubscribable()) |
232 | 232 | throw new IllegalStateException("Cannot subscribe to "+sub+" event!"); |
233 | | - LOGGER.debug(String.format("Subscribing to Event: %s", sub.name())); |
| 233 | + LOGGER.info(String.format("Subscribing to Event: %s", sub.name())); |
234 | 234 | JsonObject command = new JsonObject(); |
235 | 235 | command.addProperty("cmd", "SUBSCRIBE"); |
236 | 236 | command.addProperty("evt", sub.name()); |
@@ -265,7 +265,7 @@ public void close() |
265 | 265 | try { |
266 | 266 | pipe.close(); |
267 | 267 | } catch (IOException e) { |
268 | | - LOGGER.debug("Failed to close pipe", e); |
| 268 | + LOGGER.info("Failed to close pipe", e); |
269 | 269 | } |
270 | 270 | } |
271 | 271 |
|
@@ -385,19 +385,19 @@ private void startReading() |
385 | 385 | break; |
386 | 386 |
|
387 | 387 | case ACTIVITY_JOIN: |
388 | | - LOGGER.debug("Reading thread received a 'join' event."); |
| 388 | + LOGGER.info("Reading thread received a 'join' event."); |
389 | 389 | break; |
390 | 390 |
|
391 | 391 | case ACTIVITY_SPECTATE: |
392 | | - LOGGER.debug("Reading thread received a 'spectate' event."); |
| 392 | + LOGGER.info("Reading thread received a 'spectate' event."); |
393 | 393 | break; |
394 | 394 |
|
395 | 395 | case ACTIVITY_JOIN_REQUEST: |
396 | | - LOGGER.debug("Reading thread received a 'join request' event."); |
| 396 | + LOGGER.info("Reading thread received a 'join request' event."); |
397 | 397 | break; |
398 | 398 |
|
399 | 399 | case UNKNOWN: |
400 | | - LOGGER.debug("Reading thread encountered an event with an unknown type: " + |
| 400 | + LOGGER.info("Reading thread encountered an event with an unknown type: " + |
401 | 401 | json.get("evt").getAsString()); |
402 | 402 | break; |
403 | 403 | default: |
@@ -454,8 +454,7 @@ private void startReading() |
454 | 454 | listener.onDisconnect(this, ex); |
455 | 455 | } |
456 | 456 | }); |
457 | | - |
458 | | - LOGGER.debug("Starting IPCClient reading thread!"); |
| 457 | + LOGGER.info("Starting IPCClient reading thread!"); |
459 | 458 | readThread.start(); |
460 | 459 | } |
461 | 460 |
|
|
0 commit comments