forked from CDAGaming/DiscordIPC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- I truly don't know what past me was on going away from this, chief.
- Loading branch information
Showing
5 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,13 @@ | |
import com.jagrosh.discordipc.entities.pipe.Pipe; | ||
import com.jagrosh.discordipc.entities.pipe.PipeStatus; | ||
import com.jagrosh.discordipc.exceptions.NoDiscordClientException; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.Closeable; | ||
import java.io.IOException; | ||
import java.lang.management.ManagementFactory; | ||
import java.util.HashMap; | ||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Represents a Discord IPC Client that can send and receive | ||
|
@@ -54,7 +55,7 @@ | |
* @author John Grosh ([email protected]) | ||
*/ | ||
public final class IPCClient implements Closeable { | ||
private final Logger LOGGER = Logger.getLogger("IPC-Client"); | ||
private static final Logger LOGGER = LoggerFactory.getLogger(IPCClient.class); | ||
private final long clientId; | ||
private final boolean debugMode, verboseLogging, autoRegister; | ||
private final HashMap<String, Callback> callbacks = new HashMap<>(); | ||
|
@@ -202,15 +203,6 @@ private static int getPID() { | |
return Integer.parseInt(pr.substring(0, pr.indexOf('@'))); | ||
} | ||
|
||
/** | ||
* Retrieves this IPCClient's {@link Logger} to handle received events. | ||
* | ||
* @return the current {@link Logger} instance | ||
*/ | ||
public Logger getLogger() { | ||
return this.LOGGER; | ||
} | ||
|
||
/** | ||
* Sets this IPCClient's {@link IPCListener} to handle received events. | ||
* <p> | ||
|
@@ -341,7 +333,7 @@ public void connect(DiscordBuild... preferredOrder) throws NoDiscordClientExcept | |
if (debugMode) { | ||
ex.printStackTrace(); | ||
} else { | ||
LOGGER.severe("Unable to register application, enable debug mode for trace..."); | ||
LOGGER.error("Unable to register application, enable debug mode for trace..."); | ||
} | ||
} | ||
} | ||
|
@@ -698,7 +690,7 @@ private void readPipe(final IPCClient instance) { | |
break; | ||
} | ||
} catch (Exception e) { | ||
LOGGER.severe(String.format("Exception when handling event: %s", e)); | ||
LOGGER.error(String.format("Exception when handling event: %s", e)); | ||
} | ||
} | ||
} | ||
|
@@ -707,7 +699,7 @@ private void readPipe(final IPCClient instance) { | |
if (listener != null) | ||
listener.onClose(instance, p.getJson()); | ||
} catch (IOException | JsonParseException ex) { | ||
LOGGER.severe(String.format("Reading thread encountered an Exception: %s", ex)); | ||
LOGGER.error(String.format("Reading thread encountered an Exception: %s", ex)); | ||
|
||
pipe.setStatus(PipeStatus.DISCONNECTED); | ||
if (listener != null) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters