【问题标题】:how to remove (HTTPLog)-Static: isSBSettingEnabled false?如何删除 (HTTPLog)-Static: isSBSettingEnabled false?
【发布时间】:2020-11-19 11:25:55
【问题描述】:

此日志消息的含义是什么?怎么去掉?

 I/System.out: (HTTPLog)-Static: isSBSettingEnabled false

它淹没了我的日志。

【问题讨论】:

    标签: android android-studio logging


    【解决方案1】:

    该消息是一个 INFO 级别的日志条目,由名为“SBServiceAPI”的三星 http 库类创建,并将其发送到 System.out。因此,删除这些消息的方法如下:

    添加此行,例如到你的 onCreate 方法:

    System.setOut(new FilteringPrintStream(System.out));
    

    并将这个类添加到您的项目中:

    public class FilteringPrintStream extends PrintStream {
    
        public FilteringPrintStream(OutputStream out)  {
            super(out);
        }
    
        @Override
        public void println(String x) {
            if (x==null || !x.contains("isSBSettingEnabled")) {
                super.println(x);
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2016-06-04
      • 1970-01-01
      • 2016-07-29
      • 2022-08-08
      • 1970-01-01
      • 1970-01-01
      • 2019-05-10
      • 2021-10-23
      • 1970-01-01
      相关资源
      最近更新 更多