Null when using minecraft log formatter

Discussion in 'Plugin Development' started by Sorroko, Mar 24, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Sorroko

    I get an error when I try to format a LogRecord, here is my publish method from my custom handler:
    Code:
    @Override
        public void publish(LogRecord record) {
            if (!isLoggable(record))
                return;
         
            // Output the formatted data to the file
            addToConsole(getFormatter().formatMessage(record));
        }
    I have tried addToConsole(record.getMessage()); and it works fine, so I am sure its the formatter. Is it a bukkit bug?

    EDIT: Ah my error might be useful
    Code:
    java.lang.NullPointerException
        at me.ryan7745.servermanager.gui.LogHandler.publish(LogHandler.java:31)
        at java.util.logging.Logger.log(Logger.java:478)
        at java.util.logging.Logger.doLog(Logger.java:500)
        at java.util.logging.Logger.log(Logger.java:523)
        at java.util.logging.Logger.info(Logger.java:1042)
        at me.ryan7745.servermanager.Util.debug(Util.java:36)
        at me.ryan7745.servermanager.ServerManager.onEnable(ServerManager.java:79)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:336)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:250)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:232)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:374)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:361)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:187)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    
    I hate bumping but... Bump :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. Offline

    tobindev

  3. Offline

    Sorroko

    tobindev Thanks for replying, strange that it doesnt work though. Ill look into the source above.
     
  4. Offline

    tobindev

    ryan7745 ok do this ;) tell me later whether it has worked or not
     
Thread Status:
Not open for further replies.

Share This Page