From 0adc1c1be039632a45c91d91a03e499c4af42e65 Mon Sep 17 00:00:00 2001 From: szumielxd <43210079+szumielxd@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:26:11 +0100 Subject: [PATCH] Replaced `Throwable#printStackTraces` with `Logger#error` --- .../main/java/com/plotsquared/core/command/MainCommand.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java index 3e8db6ac4f..aa8fa8ce0d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java @@ -151,8 +151,7 @@ public static MainCommand getInstance() { try { injector.getInstance(command); } catch (final Exception e) { - LOGGER.error("Failed to register command {}", command.getCanonicalName()); - e.printStackTrace(); + LOGGER.error(() -> "Failed to register command %s".formatted(command.getCanonicalName()), e); } } @@ -251,7 +250,7 @@ public CompletableFuture execute( } catch (CommandException e) { throw e; } catch (Throwable e) { - e.printStackTrace(); + LOGGER.error("A error occurred while executing plot command", e); String message = e.getMessage(); if (message != null) { data.player().sendMessage(