What is the best ?

Discussion in 'Performance Tweaking' started by PYRRH4_, May 25, 2015.

  1. What is the best ?

    plugin.getServer().getLogger() of plugin.getLogger().log() ?
     
  2. public void logMessage(String message){
    plugin.getInstance().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getServer().getLogger().info(message);
    }

    Seriously though, it doesn't matter.
     
  3. All these "get" methods are called accessors (or informally getters).
    They really aren't much difference between using 1 or 2 getters.
    You're fine either way:)
    I personally would use plugin.getLogger.
     
  4. Your Plugin#getLogger() is customized to show the name in the console so it's easier to identify which plugin sent the output.

    You cannot use the Plugin#getLogger() in the onEnable method of BungeeCord, so be careful.