当前位置:网站首页>Modify the default log level

Modify the default log level

2022-06-25 06:44:00 Ah @ potato

1、log Grade introduction

        log Level common 8 individual , Namely : 

Macro definition Level describe
KERN_EMERG0 Emergency message , This information will cause the system to crash
KERN_ALERT1 Prompt for some immediate action
KERN_CRIT2 The key information , There are usually serious software or hardware problems
KERN_ERR3 Usually used to report errors , For example, device drivers are usually used to report hardware operation failures, etc
KERN_WARNING4 Warning message , Used to warn against problems that do not cause serious system exceptions
KERN_NOTICE5 Used in normal but noteworthy situations , For example, a large number of safety related log
KERN_INFO6 Information , Many drivers will use this level to print when the hardware starts Log
KERN_DEBUG7 For printing debugging information

2、 Dynamic modification log Grade

         Get into adb shell

        Use cat proc/sys/kernel/printk View the current log Grade , Such as : 

       ​        

         Use echo 3 6 1 7 > proc/sys/kernel/printk Modify level

         notes : Just change the first number , The smaller the numerical , The higher the priority .

3、 Change the default log Grade

         If you modify the default log Grade , The corresponding file configuration information needs to be modified ;

         File path :arch/arm/boot/dts/xxx.dts, Such as :

          ​​​​​​​​​​​​​​​​​​​​​    

         Just put the loglevel You can modify the value of .

原网站

版权声明
本文为[Ah @ potato]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200607151095.html