Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
logger refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JustS-js committed Apr 17, 2022
1 parent 028a02e commit c59e326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/main/java/net/just_s/ctpmod/CTPMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class CTPMod implements ClientModInitializer {

@Override
public void onInitializeClient() {
LOGGER.info("Hello Fabric world!");
}

public void listPoints() {
Expand Down Expand Up @@ -149,7 +148,7 @@ public void finishReconnect() {
public void cancelReconnect() {
try {
reconnectThread.join();
} catch (InterruptedException ignored) {
} catch (InterruptedException | NullPointerException ignored) {
}
LOGGER.info("Reconnecting cancelled.");
MC.setScreen(new DisconnectedScreen(new MultiplayerScreen(new TitleScreen()), new LiteralText("§8[§6CatTeleport§8]"), new LiteralText("cancelReconnect")));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/just_s/ctpmod/util/ReconnectThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ReconnectThread(ServerInfo serverInfo, int start, int end) {
public void run() {
try {
int[] s = {secondsToReconnect - CTPMod.delta, 0};
CTPMod.LOGGER.debug("reconnect in " + Collections.max(Arrays.asList(ArrayUtils.toObject(s))) + " sec");
CTPMod.LOGGER.info("reconnect in " + Collections.max(Arrays.asList(ArrayUtils.toObject(s))) + " sec");
Thread.sleep(Collections.max(Arrays.asList(ArrayUtils.toObject(s))) * 1000L);
for (int i1 = 0; i1 < 10; i1++) {
pingServer();
Expand All @@ -42,7 +42,7 @@ public void run() {
}
return;
} catch (IOException | InterruptedException e) {
CTPMod.LOGGER.debug("Reconnection failed. Reason: " + e.getMessage());
CTPMod.LOGGER.error("Reconnection failed. Reason: " + e.getMessage());
}
MinecraftClient.getInstance().execute(() -> CTPMod.INSTANCE.cancelReconnect());
}
Expand Down

0 comments on commit c59e326

Please sign in to comment.