linux - difference between console log level and default log lovel -


in module programming read ,

if log level

  less console log level displayed ,    higher mentioned in log files ,  

if dont specify log level in printk statement default log level taken .

i saw default , console log level

by

cat /proc/sys/kernel/printk

and result

4 4 1 7

here both default , console same .

i dont understand why default log level created . going use default log level in anywhere .

what exact difference between console log level , default log level .

i new module programming.

as know have different kernel level logs:

#define kern_emerg "<0>" /* system unusable*/ #define kern_alert "<1>" /* action must taken immediately*/ #define kern_crit "<2>" /* critical conditions*/ #define kern_err "<3>" /* error conditions*/ #define kern_warning "<4>" /* warning conditions*/ #define kern_notice "<5>" /* normal significant condition*/ #define kern_info "<6>" /* informational*/ #define kern_debug "<7>" /* debug-level messages*/ 

okay let put discussion separately:

console log level used set log levels can displayed on console window with log levels(printk) < console log level(4 taken considering wrt case).

i.e., print kernel messages printk using log levels 0,1,2 , 3. rest 4 7 logged in circular buffer maintained kernel - can seen issuing "dmesg".

now if move on default log level:

whenever use printk without log level info, eg:

printk("insmod first driver\n"); // log level set "kern_warning"(as default log level 4).

so difference console log used decide needed printed on console , default log level used log level taken default if not mentioned printk during kernel module programming.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -