2 jadecsd jadecsd 于 2014.09.29 16:03 提问

真机调试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

这些信息不间断的打印,将与程序相关的有用信息淹没。如何关闭这些没用的信息。

5个回答

irisqian
irisqian   2015.01.06 17:25

不是可以通过添加filter 打上logtag把不属于tag的过滤掉吗?

darkread
darkread 问题不在这里,在于手机不断的在打印信息,要很久才出我们需要的日志
一年多之前 回复
u013897238
u013897238 说的简单,怎么做
2 年多之前 回复
u011359394
u011359394   2015.02.12 20:10

有没有解决?我也是这样

QM_login
QM_login   2016.01.14 15:42

大家好,这个问题我以前也遇到过,设置步骤:windows---preference---左侧栏点开Android----Logcat----看到右边第一行的输入框,有的版本默认是0,有的是5000。(0就代表默认值5000,意思是Logcat默认打印5000条信息,超出后,之前打印的就会被覆盖掉),真机也在运行其他程序,所以我们想要看到的logcat信息很快就会被覆盖。
在默认值输入框里,输入一个比较大的数字就可以了,比如几十万、几百万等,都能有效解决大家的问题。

u012346406
u012346406   2015.07.02 19:25

1,用过滤器是一个很通用的方法,可以过滤出自己需要的指定的信息。
2,Window---Preferences---Android---logcat--取消第一个选中,
在调试中,向下的箭头也取消选中就行了

u013897238
u013897238 没用啊
2 年多之前 回复
sanyuv
sanyuv   2015.08.09 10:05

真机调试Android项目,logcat不断不间断的打印无用信息将有用信息淹没 ,这个是因为你使用了真机,你用genymotion模拟机就可以了,就不会有了

u013897238
u013897238 就是用真机出了问题,需要解决啊,,都知道模拟机没问题
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!