[Tutorial] How to detect server console output

Discussion in 'Resources' started by MinecraftShamrock, Jun 3, 2013.

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

    Plo124

    MinecraftShamrock
    What if a plugin uses System.out.println() can we catch that, or is there a native java method for that?
     
  2. Offline

    mickedplay

    Cirno Which of These tons of imports? :p
     
  3. Offline

    unforgiven5232

    MinecraftShamrock I'm sorry but can't you just do Scanner scan = new scanner(System.out)
     
  4. Offline

    Cirno

    You have to hijack System.out with System.setOut and your own PrintStream.
     
  5. Offline

    Plo124

    Cirno
    Sounds pretty simple :p
     
  6. Offline

    phybros


    This code doesn't work for me with 1.7.9-R0.2 some sort of mismatche between log4j loggers and java.util loggers. Can you post your import statements as well? Maybe a link to a project that uses this code?

    Thanks

    Edit: I changed my bukkit maven dependency to use craftbukkit instead, and suddenly I had access to all the right logging classes. Thanks, it works great!
     
  7. Offline

    EcMiner

    When exactly is the close method being called? I tried to do System.out.println(); in the close method, but when I close the server by closing the windows command prompt, nothing happens
     
    Habbolant likes this.
Thread Status:
Not open for further replies.

Share This Page