android studio some logs have been lost

本文分享了一次解决手机应用中日志输出异常的问题经历。通过深入查看日志,发现并非所有日志丢失,而是部分错误的日志打印位置导致了显示不及时。最终通过删除不当的日志打印解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

突然碰见这种情况措手不及,看了别的解决办法,都是重启手机偏多,尝试无果,后来自己看log,发现并不是全部都打 some logs have been lost   中间还夹杂其他log,然后发现问题出在夹杂的这些log上面,后来发现log打印的位置不对导致不停输出,导致显示不及时,所以才会出现这种问题,删掉就好了
Sure! Here's an example of Android camera stream logs: ``` D/CameraManagerGlobal: Connecting to camera service I/CameraManager: Using legacy camera HAL. D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_OPENING I/Camera: CameraDeviceState:CAMERA_STATE_OPENED W/Camera: CameraService::connect call from pid 1234; forcing disconnect() D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_IDLE I/Camera: CameraDeviceState:CAMERA_STATE_PREVIEW D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_RECORDING D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_PREVIEW D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface D/Camera: app passed NULL surface I/Camera: CameraDeviceState:CAMERA_STATE_IDLE I/Camera: CameraDeviceState:CAMERA_STATE_CLOSED ``` These logs show the various states of the camera device, including connecting to the camera service, opening the camera, setting up the preview stream, and recording video. The "app passed NULL surface" messages indicate that the app did not provide a valid surface for displaying the camera preview.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值