Which is the best way to debug a plugin

Discussion in 'Plugin Development' started by ToastHelmi, Nov 25, 2012.

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

    ToastHelmi

    hey guys
    what is best end efficient way to debug a plugin
     
  2. Offline

    Tirelessly

    Well figure out the problem.. If there's a stacktrace, that makes it easy.. If there's no stacktrace, think about your logic in whatever section of code is going wrong and throw in some debug statements.. I can't really help with no information about what your problem is.
     
  3. Offline

    Archelaus

    Whilst some would disagree with me, I feel the best way to "debug" a plugin is to code a separate debug mode, preferably enabled via the configuration files for your plugin.

    In said debug mode your plugin would log specific actions which are key to your plugins interaction with the server and it's players. For instance, a plugin which handles shop chests would log certain information when ever a chest is opened. Using Loggers or System.out.println you could get a good idea of what is happening under the hood.
     
  4. Offline

    ZeusAllMighty11

    I just like to use System.out.println()...
    A lot.


    Something doesn't work? Add System.out.println() after every line until you find one line that doesn't print, then find out why.
     
  5. Offline

    willeb96

    I like to do broadcastMessage("DEBUG: Description of what's currently happening.");
     
  6. Offline

    raGan.

    All combined together;
    debug-mode in config + logging ton of useful info
     
  7. Offline

    Codex Arcanum

    Depends on how serious/deep the problem is. Do I need to find out why a single if statement isn't firing? Add some .println()'s and have done. ConcurrentModificationException? Mysterious NullPointerExceptions I can't seem to trace? Massive processes with hundreds of lines of code returning incorrect outputs? Better add a debug mode, otherwise this is gonna be a pain.

    Of course, this is going to be a matter of opinion. There really is no right answer.
     
  8. Offline

    andf54

    System.out.println() No competition.
    In eclipse type syso and let autocomplete it.
     
  9. Offline

    fireblast709

    Usually a stacktrace itself shows where the problem is, for the rest it basically depends on what the problem is
     
Thread Status:
Not open for further replies.

Share This Page