问题描述
- 真机调试Android项目,logcat不断不间断的打印无用信息将有用信息淹没
-
eclipse 下用真机调试Android项目,logcat不断打印光传感器和电池等关于真机的信息:
09-29 15:56:35.437: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 244
09-29 15:56:35.640: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 238
09-29 15:56:35.843: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 258
09-29 15:56:36.046: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263
09-29 15:56:36.250: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263
09-29 15:56:36.453: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 246
09-29 15:56:36.640: D/STATUSBAR-NetworkController(709): refreshSignalCluster: data=0 bt=false
09-29 15:56:36.664: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 241
09-29 15:56:36.867: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 238
09-29 15:56:37.070: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 255
09-29 15:56:37.273: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 249
09-29 15:56:37.476: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263
09-29 15:56:37.648: D/STATUSBAR-NetworkController(709): refreshSignalCluster: data=0 bt=false
09-29 15:56:37.679: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 249
09-29 15:56:37.882: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 258
09-29 15:56:38.085: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 238
09-29 15:56:38.289: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 241
09-29 15:56:38.492: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 246
09-29 15:56:38.648: D/STATUSBAR-NetworkController(709): refreshSignalCluster: data=0 bt=false
09-29 15:56:38.703: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263
09-29 15:56:38.710: D/BatteryService(401): update start
09-29 15:56:38.718: D/BatteryService(401): level:60 scale:100 status:3 health:2 present:true voltage: 3890 temperature: 369 technology: Li-ion AC powered:false USB powered:true icon:17303331 invalid charger:0 online:4 charge type:0 current avg:135
09-29 15:56:38.726: D/STATUSBAR-BatteryController(709): onReceive() - ACTION_BATTERY_CHANGED
09-29 15:56:38.734: E/MtpService(25152): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
09-29 15:56:38.734: E/MtpService(25152): battPlugged Type : 2
09-29 15:56:38.734: D/STATUSBAR-BatteryController(709): onReceive() - level:60
09-29 15:56:38.734: D/STATUSBAR-BatteryController(709): onReceive() - plugged:2
09-29 15:56:38.734: D/STATUSBAR-BatteryController(709): onReceive() - BATTERY_STATUS_DISCHARGING: tw_stat_sys_battery_usb_not_charge
09-29 15:56:38.734: D/STATUSBAR-PhoneStatusBar(709): ACTION_BATTERY_CHANGED
09-29 15:56:38.734: D/STATUSBAR-PhoneStatusBar(709): NORMAL_BATTERY
09-29 15:56:38.906: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 261
09-29 15:56:39.109: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 261
09-29 15:56:39.312: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 238
09-29 15:56:39.515: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 241
09-29 15:56:39.656: D/STATUSBAR-NetworkController(709): refreshSignalCluster: data=0 bt=false
09-29 15:56:39.718: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 244
09-29 15:56:39.921: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 238
09-29 15:56:40.125: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 261
09-29 15:56:40.328: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 261
09-29 15:56:40.531: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263
09-29 15:56:40.664: D/STATUSBAR-NetworkController(709): refreshSignalCluster: data=0 bt=false
09-29 15:56:40.734: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 244
09-29 15:56:40.867: E/Watchdog(401): !@Sync 24297
09-29 15:56:40.937: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 249
09-29 15:56:41.140: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 238
09-29 15:56:41.343: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 258
09-29 15:56:41.546: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 252
09-29 15:56:41.750: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263
09-29 15:56:41.953: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 261
09-29 15:56:42.156: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 249
09-29 15:56:42.359: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 255
09-29 15:56:42.562: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 235
09-29 15:56:42.671: D/STATUSBAR-NetworkController(709): refreshSignalCluster: data=0 bt=false
09-29 15:56:42.765: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 249
09-29 15:56:42.968: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 244
09-29 15:56:43.039: D/dalvikvm(29098): GC_CONCURRENT freed 389K, 22% free 7666K/9735K, paused 9ms+2ms, total 30ms
09-29 15:56:43.171: E/LightSensor(401): LightSensor::readEvents mPendingEvent.light = 263这些信息不间断的打印,将与程序相关的有用信息淹没。如何关闭这些没用的信息。
解决方案
不是可以通过添加filter 打上logtag把不属于tag的过滤掉吗?
解决方案二:
有没有解决?我也是这样
解决方案三:
1,用过滤器是一个很通用的方法,可以过滤出自己需要的指定的信息。
2,Window---Preferences---Android---logcat--取消第一个选中,
在调试中,向下的箭头也取消选中就行了
解决方案四:
大家好,这个问题我以前也遇到过,设置步骤:windows---preference---左侧栏点开Android----Logcat----看到右边第一行的输入框,有的版本默认是0,有的是5000。(0就代表默认值5000,意思是Logcat默认打印5000条信息,超出后,之前打印的就会被覆盖掉),真机也在运行其他程序,所以我们想要看到的logcat信息很快就会被覆盖。
在默认值输入框里,输入一个比较大的数字就可以了,比如几十万、几百万等,都能有效解决大家的问题。
解决方案五:
真机调试Android项目,logcat不断不间断的打印无用信息将有用信息淹没 ,这个是因为你使用了真机,你用genymotion模拟机就可以了,就不会有了
时间: 2024-10-31 04:34:56