Skip to content

Implement kernel logs and add the klog scheme

Jeremy Soller requested to merge nounoursheureux:klog into master

Created by: nounoursheureux

Problem: The kernel doesn't keep logs, so if it wants to communicate with the user the only way is to print something on the screen. While this works well for critical errors (because you want the user to see them), it is excessive for warnings or simple informations.

Solution: Have the kernel keep tracks of info/warning/error logs, and let the users access them when they want to.

Changes introduced by this pull request:

  • Add the klog function which add a message to the kernel logs.
  • Add the LogLevel enum.
  • Add the klog scheme

To read the kernel logs you can simply do:

$ cat klog:

TODOs:

  • Maybe use a circular buffer to avoid using too much memory.
  • Add a way read logs only of a certain priority level. Here is an example of the syntax that I'm thinking of:
$ cat klog:critical/error/warning

to view only critical/error/warning logs and

$ cat klog:!debug/!info

What do you think ? to view everything except debug and info logs.

State: Ready.

Merge request reports