zoukankan      html  css  js  c++  java
  • ---Android logcat 记录日志

     
    Android的日志记录信息可以通过logcat来访问.    这一个功能被整合进了ddms和adt中,  但是你可以直接通过adb命令来进行访问, 命令格式如下:

    adb logcat <option> <filter>


    1.  显示全部的日志信息:
         adb -e logcat    #for emulators
         adb -d logcat   #for the real devices
    如果设对应的备多余一个, 那么就提示多个设备, 你可以增加通过 -s 设备系列号的方式 启动这个命令连线板子,  通过adb -d|-e devices 查看设备系列号
    默认地, 日志记录模式被设置为brief.  例如, 下面显示来自线程ID 20054的信息

    I/AppLog(20054) : An Infomation Log message.

    现在的情况: (谁便捡一条)
    06-24 06:12:06.958   213   413 D AudioHardwareTiny: close device       #目前默认的显示已经足够好了, 时间显示精确到了ms 
    带与不带 -v time的情况显示如下不同:

    06-24 06:20:18.619 V/EventHub(  460): awoken after wake()   
    06-24 06:20:18.619   460   530 V EventHub: awoken after wake()
    只带了-v threadtime, 可见默认就是这个了 
    06-24 06:33:18.642   460   530 V EventHub: awoken after wake()

    2.  日志严重性等级分类:
          V/D/I/W/E/F/S     V D I W E F 这6个是在程序了打印日志使用的:  ex  Log.v  ...Log.e  Log.f () 真心没有见过的了!   
         S: Silenct  关闭打印

    3.  过滤器:
    adb logcat RockFFPlayer:S    # 过滤掉某个TAG的打印   librkffplayer.so的媒体打印干扰当前apk的debug,  就可以用过这个命令过滤掉他们 
    adb logcat RockFFPlayer:*  *:S # 就可以只是看摸个TAG的打印

    4. -b的参数选择 (内部有五个ring buffer)
     默认等于  -b main,system,crash
    -b all 选择全部
    -b radio
    -b event

    5. 关于缓冲区的size
    adb logcat -g -b all  

    我的rk3326显示成如下这样, 感觉64K不够大了!!!!

    main: ring buffer is 64Kb (57Kb consumed), max entry is 5120b, max payload is 4068b
    radio: ring buffer is 64Kb (22Kb consumed), max entry is 5120b, max payload is 4068b
    events: ring buffer is 64Kb (61Kb consumed), max entry is 5120b, max payload is 4068b
    system: ring buffer is 64Kb (61Kb consumed), max entry is 5120b, max payload is 4068b
    crash: ring buffer is 64Kb (1Kb consumed), max entry is 5120b, max payload is 4068b
    kernel: ring buffer is 64Kb (0b consumed), max entry is 5120b, max payload is 4068b




  • 相关阅读:
    SAP 增强篇 Method1 BADI增强的查找方法
    增强篇2 生产订单屏幕增强
    增强篇1 PO保存增强
    ABAP DEMO篇21 选择屏幕显示说明TEXT
    ABAP字符串操作1 检查字段小数位的长度
    采购信息记录批导BAPI
    POPUP_GET_VALUES 金额字段不可编辑
    使用弹窗批量修改数据POPUP_GET_VALUES
    Win10手记-取色器ColorPicker的实现
    ASP.NET Web API实现微信公众平台开发(三)自定义菜单
  • 原文地址:https://www.cnblogs.com/bzhao/p/13187268.html
Copyright © 2011-2022 走看看