From 743f9028b91a61dc678d281b14496bfd46d80f8a Mon Sep 17 00:00:00 2001 From: Govindas <16716020+GovindasOM@users.noreply.github.com> Date: Sat, 12 Jun 2021 15:02:02 +0300 Subject: [PATCH] Improve config & console message for log deletion --- .../net/limework/automaticlogdeleter/AutomaticLogDeleter.java | 2 ++ src/main/resources/config.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java b/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java index f7c19c8..a55b5b8 100644 --- a/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java +++ b/src/main/java/net/limework/automaticlogdeleter/AutomaticLogDeleter.java @@ -45,6 +45,8 @@ public final class AutomaticLogDeleter extends JavaPlugin { if (!file.delete()) { Bukkit.getLogger().log(Level.WARNING, "Failed to delete server log file! Are you sure the file permissions are correct?"); + } else { + Bukkit.getLogger().log(Level.INFO, "Deleted log file " + file.getName()); } } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ae6ea26..baf0b70 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,6 +2,7 @@ #lines that start with a hashtag are comments #delete logs older than 24 hours by default +#you can set it to -1 to simply delete all logs #default value: 86400 delete-logs-older-than-seconds: 86400