From bcd147052ccb897e94a9acced38979db7ed969f1 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Sun, 9 May 2021 21:07:23 +0200 Subject: [PATCH] Added static variable for logger-access --- .../eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java index 54ced32..9c24ada 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java @@ -8,6 +8,7 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import java.io.File; +import java.util.logging.Logger; public class Main extends JavaPlugin { @@ -16,7 +17,10 @@ public class Main extends JavaPlugin { public static FileConfiguration config; public static FileConfiguration data; + public static Logger log; + public void onEnable() { + log = getLogger(); plugin = this; @@ -25,12 +29,12 @@ public class Main extends JavaPlugin { loadConfigs(); - getLogger().info("Plugin activated"); + log.info("Plugin activated"); } public void onDisable() { - getLogger().info("Plugin deactivated"); + log.info("Plugin deactivated"); } public void loadConfigs() { @@ -46,7 +50,7 @@ public class Main extends JavaPlugin { dataFile ); }catch (Exception ex){ - getLogger().severe("Could not load/create data.yml!"); + log.severe("Could not load/create data.yml!"); ex.printStackTrace(); Bukkit.getPluginManager().disablePlugin(this); }