NumberMacroLog LevelDescriptionEquivalent
0pr_emergEmergencySystem is unusable.KERN_EMERG
1pr_alertAlertAction must be taken immediately.KERN_ALERT
2pr_critCriticalCritical conditions.KERN_CRIT
3pr_errErrorError conditions.KERN_ERR
4pr_warnWarningWarning conditions.KERN_WARNING
5pr_noticeNoticeNormal but significant condition.KERN_NOTICE
6pr_infoInformationalInformational messages.KERN_INFO
7pr_debug
pr_devel
DebugDebugging messages. pr_debug() and pr_devel() if DEBUG is definedKERN_DEBUG
  • The number corresponds to the log level used by the Linux kernel, with lower numbers indicating higher severity.
  • For example, if the log level is set to 4 (Warning), only messages from pr_emerg to pr_warn will appear in the system logs. Default log level is generally set to 6.
  • You can check the current console_loglevel with:
cat /proc/sys/kernel/printk
4        4        1        7

echo 8 > /proc/sys/kernel/printk

dmesg -n 5

Reference