content: package com.r00t.util;
  
  import java.io.ByteArrayOutputStream;
  import java.io.PrintStream;
  
  public class FilteredPrintStream extends PrintStream {
      public FilteredPrintStream() {
          super(new ByteArrayOutputStream());
      }
      
      @Override
      public void println(String x) {
          if (x != null && shouldPrint(x)) {
              System.out.println(x);
          }
      }
      
      @Override
      public void print(String s) {
          if (s != null && shouldPrint(s)) {
              System.out.print(s);
          }
      }
      
      private boolean shouldPrint(String message) {
          if (message == null) return false;
          
          String lower = message.toLowerCase();
          if (lower.contains("debug") || lower.contains("callid=") || lower.contains("[anonymous]") ||
              lower.contains("nc.bs.framework") || message.matches(".*\\d{4}/\\d{2}/\\d{2}.*")) {
              return false;
          }
          
          return !message.contains("FileNotFoundException") && !message.contains("ERROR") &&
                 !message.contains("trustIPList.conf") && !message.contains("trustServiceList.conf") &&
                 !message.contains("tokenSeed.conf") && !message.contains("at java.io.FileInputStream") &&
                 !message.contains("at nc.bs.framework");
      }
  }
  
  