• 在 kernel 下打出 有帶參數的log。 怪異現象與解決方式。


    code

    2717         battery_log(BAT_LOG_CRTI, "youchihwang abc10010 xxxaaa8-2
    ");
    2718         battery_log(BAT_LOG_CRTI, "youchihwang abc10010 xxxaaa8-3
    ");
    .....
    .....
    .....
    2731         battery_log(BAT_LOG_CRTI, "youchihwang5 CHR_Type_num=%d
    ",
    2732                         CHR_Type_num);
    2733         battery_log(BAT_LOG_CRTI, "youchihwang6 CHR_Type_num=%d
    ",
    2734                         CHR_Type_num);

    log

    2314 01-01 00:02:29.519233    71    71 E [  278.055360]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang abc10010 xxxaaa8-2                                        
    2315 01-01 00:02:29.519239    71    71 E [  278.055366]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang abc10010 xxxaaa8-3
    ....
    ....
    ....
      28 01-01 00:01:55.445030    71    71 E [  243.981157]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang5 CHR_Type_num=3                                           
      29 01-01 00:01:55.445038    71    71 E [  243.981165]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang6 CHR_Type_num=3

    小結:

             在 kernel 中打 log,

             不論是帶有參數的 log,或是沒有帶參數的 log,

             在其後加上 " " 或 " " 的結果都是一樣的,

             都會移到新的一行。

         


        

    code

    2721                 battery_log(BAT_LOG_CRTI, "youchihwang1 CHR_Type_num  :%d
    ", CHR_Type_num);
    2723                 battery_log(BAT_LOG_CRTI, "youchihwang1-1 CHR_Type_num:%d
    ", CHR_Type_num);
    2725                 battery_log(BAT_LOG_CRTI, "youchihwang2 CHR_Type_num  :%d 
    ", CHR_Type_num);
    2727                 battery_log(BAT_LOG_CRTI, "youchihwang3 CHR_Type_num  : %d
    ", CHR_Type_num);
    2729                 battery_log(BAT_LOG_CRTI, "youchihwang4 CHR_Type_num  : %d 
    ", CHR_Type_num);
    2731                 battery_log(BAT_LOG_CRTI, "youchihwang5 CHR_Type_num  =%d
    ", CHR_Type_num);
    2733                 battery_log(BAT_LOG_CRTI, "youchihwang6 CHR_Type_num  =%d
    ", CHR_Type_num);
    2735                 battery_log(BAT_LOG_CRTI, "youchihwang_CHR_Type_num   =%d
    ", CHR_Type_num);

    log

      23 01-01 00:01:55.444985    71    71 E [  243.981112](4)[71:pmic_thread][name:battery_common_fg_20&]: 3
      24 01-01 00:01:55.445002    71    71 E [  243.981129](4)[71:pmic_thread][name:battery_common_fg_20&]: 3
      25 01-01 00:01:55.445010    71    71 E [  243.981137](4)[71:pmic_thread][name:battery_common_fg_20&]: 3
      26 01-01 00:01:55.445017    71    71 E [  243.981144](4)[71:pmic_thread][name:battery_common_fg_20&]: 3
      27 01-01 00:01:55.445024    71    71 E [  243.981151](4)[71:pmic_thread][name:battery_, common_fg_20&]: 3
      28 01-01 00:01:55.445030    71    71 E [  243.981157]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang5 CHR_Type_num=3                                           
      29 01-01 00:01:55.445038    71    71 E [  243.981165]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang6 CHR_Type_num=3
      30 01-01 00:01:55.445045    71    71 E [  243.981172]: (4)[71:pmic_thread][name:battery_common_fg_20&]youchihwang_CHR_Type_num=3

    小結:

             在 kernel 中要打出有帶參數的 log (如上),

             比對 前 5 個 與 後 3 個可得知,

             在 "%" 前需加上 "=" 。

  • 相关阅读:
    UVALive 3938 一道被我WA了的线段树
    批量删除Zen Cart 无图片商品
    zencart加大数据表字段长度
    CSS字体中英文名称对照表
    zencart产品批量表上传后SEO三要素状态以及特价时间修改
    Linux 文件系统
    VMware Tools 安装步骤
    IDEA安装阿里规约插件
    IDEA 中无法使用 EL 表达式
    Redis主从复制
  • 原文地址:https://www.cnblogs.com/youchihwang/p/6252927.html
Copyright © 2020-2023  润新知