Minecraft Logger

Discussion in 'Plugin Development' started by tobiyas, May 30, 2012.

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

    tobiyas

    I just took a look into the logging system.

    Therefore I am not very familiar with Loggers.
    Is there an easy way to create an own Logger without showing in the Console every log?
    I just want to create some sort of "debug logger". Is this even possible with Loggers, since craftbukkit is using the global channel?

    Thanks in advance. :)
     
  2. Offline

    Don Redhorse

  3. Offline

    tobiyas

    Do I get this right? You just implementet a new Logger by rewriting the Java Implementation?
    Thought there was a more simple way...
     
  4. Offline

    messageofdeath

    Are you talking about the verbose logging? If so your supposed to make a config file and add Verbose Logging to it and it is default to false.
     
  5. Offline

    tobiyas

    Not exactly, what I meant.
    I get a new AnonymousLogger from Java and don't want all the outputs in the Main-Minecraft-Logfile.
     
  6. Logger.setLevel(Level.WARNING) shows only warning messages an higer, call that on the logger of your plugin, Logger.getLogger("minecraft.yourplugin")
    or plugin.getLogger();
     
  7. Offline

    Don Redhorse

    well.... yes... but that's a way... if you use anything like finer etc it will go only into the server.log file iirc..

    also there have been some enhancements made (there is a post in the bleeding area about it) on the logger system just a day after I released this classes.

    if you want to log to a file on your own I don't think there is a way other than the way I do it.. but I'm not sure.

    IIRC you can just copy the logger class and look at the helperclasses file to see how I implemented it... it should be quite easy to do... or you just copy and paste the part of the file logging..
     
  8. Offline

    tobiyas

    Thanks very much :)
    I found an easier way by the time. You can tell a logger to not use the handler of its parents (Logger.setUseParentHandlers(false)). That solved the problem for me.
     
  9. Offline

    Don Redhorse

    no probs... I'm not the best coder :)
     
Thread Status:
Not open for further replies.

Share This Page