Question Logging statically

renvins

New member
Aug 15, 2023
2
0
1
18
Italy
That's definitely the worst way to get a static Logger (maybe)
but the only one I've figured out (just don't want to take JavaPlugin with me)

LOGGERs are static everywhere except for spigot xD
Java:
public final class TrySpigotPlugin extends JavaPlugin {

    private static Logger logger;

    @Override
    public void onEnable() {
        logger = getLogger();
    }

    @Override
    public void onDisable() {
    }
  
    public static Logger getLog() {
        return logger;
    }
}
 
Last edited:

electronicboy

Administrator
Staff member
Dec 11, 2021
236
12
42
28
If you’re going to do it like that, just store the component logger exposed from JavaPlugin