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 個可得知,

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

  • 相关阅读:
    操作数据库系统(OLTP)和联机分析处理系统(OLAP)的区别
    BI笔记-SSAS部署的几种方式及部署后的SSAS刷新
    概念-数据仓库与元数据
    零基础学Python 3之环境准备
    OFBiz进阶之HelloWorld(五)创建新实体
    OFBIZ bug_create-component ERROR
    OFBIZ bug_ControlServlet.java:233:ERROR
    OFBiz进阶之HelloWorld(三)CRUD操作
    OFBiz进阶之HelloWorld(二)创建热部署模块
    OFBIZ bug_ControlServlet.java:239:ERROR
  • 原文地址:https://www.cnblogs.com/youchihwang/p/6252927.html
Copyright © 2011-2022 走看看