zoukankan      html  css  js  c++  java
  • 在 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 個可得知,

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

  • 相关阅读:
    Java API之时间、异常和集合
    JAVA API 之包装类、数学类和 Calendar 类
    regular expression ---正则表达式 --- REGEX 的一些补充
    正则表达式
    JavaScript 的一些应用场景分析
    JavaScript 简介
    ERROR internal error: process exited while connecting to monitor
    常用服务默认端口号
    shell笔记
    php登录注册
  • 原文地址:https://www.cnblogs.com/youchihwang/p/6252927.html
Copyright © 2011-2022 走看看