Read from Console

Discussion in 'Plugin Development' started by Codisimus, Apr 18, 2012.

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

    Codisimus

    Can anyone confirm whether it is possible to read what gets printed to the console? It is in reference to a feature request (http://dev.bukkit.org/server-mods/textplayer/?comment=151) for my plugin TextPlayer. I don't think this is possible but just thought that I should ask more experienced coders.
     
  2. How about reading from the log-file?
     
  3. Offline

    Codisimus

    I guess that would work but I'd rather not have to deal with coding that.
     
  4. Isn't there already a class for reading a log file?
     
  5. Offline

    Njol

    You can register a Handler to the default logger with Bukkit.getLogger().addHandler(...) (http://docs.oracle.com/javase/6/doc...er.html#addHandler(java.util.logging.Handler))

    I however don't know whether logging messages from all plugins can be caught using this method, as some plugins use Logger.getLogger(JavaPlugin.class.getName()), Logger.getLogger(plugin.getClass().getName()), plugin.getLogger(), Logger.getLogger("Minecraft"), etc.
     
  6. Offline

    Codisimus

    hmm I'll check that out later, thanks
     
Thread Status:
Not open for further replies.

Share This Page