3

I'm wondering if there is a way to suppress console output from a single library in processing? Specifically, I am using SimpleOpenNI and it constantly outputs stuff like the below many times a second:

[Info] [VTRgbPacketProcessor] avg. time: 22.8676ms -> ~43.73Hz [Info] [DepthPacketStreamParser] 1 packets were lost [Info] [OpenGLDepthPacketProcessor] avg. time: 5.9517ms -> ~168.019Hz

The library is working fine but the output is a bit annoying as I'm trying to use the console to test stuff.

Anyone know a way to suppress output from a specific library? I've looked through the SimpleOpenNI docs and cant find anything that helps.

Cheers

Jordan E
  • 35
  • 5

1 Answers1

2

You generally have three options:

Option 1: Hopefully the library provides a way to disable console output. Look for something like setLogLevel() or suppressWarnings().

Option 2: If the library is open source, you could just modify it yourself to get rid of the print statements.

Option 3: You could also modify the System.out variable to point to your own custom class that filters messages you don't care about.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
  • Great thanks! Opt 1 & 2 were unavailable but I found [this thread that helped](https://stackoverflow.com/questions/27800326/hook-into-system-out-println-and-modify) write a new class – Jordan E Nov 04 '17 at 04:03
  • @JordanE yep, that's pretty much exactly what I had in mind. Glad you got it figured out. – Kevin Workman Nov 04 '17 at 15:42