forked from lolo859/vystem
Vystem 0.2
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
The logging API is one of the most important of the entire kernel: it allow it to output informations with various level of importance and various sources.
|
||||
The logging API is one of the most important of the entire kernel: it allow it to output informations with various level of importance and various sources, during the early boot period. After the APs bootstrap, the log API is replaced by the print implementation provided by the standard library, because it is thread safe.
|
||||
|
||||
## Output methods
|
||||
|
||||
@@ -35,7 +35,7 @@ There are two mores functions:
|
||||
|
||||
## Output channels and log level
|
||||
|
||||
The Shelter logging API provide higher level functions to output on specific log channels. Here are all the log channels:
|
||||
The Shelter logging API provides higher level functions to output on specific log channels. Here are all the log channels:
|
||||
- `SH_LOG_DEBUG`: log level 0
|
||||
- `SH_LOG_LOG`: log level 1
|
||||
- `SH_LOG_WARNING`: log level 2
|
||||
@@ -43,6 +43,7 @@ The Shelter logging API provide higher level functions to output on specific log
|
||||
- `SH_LOG_CRITICAL`: log level 4
|
||||
- `SH_LOG_FATAL`: log level 5
|
||||
- `SH_LOG_TEST`: log level 6
|
||||
- `SH_LOG_FAULT`: log level 7
|
||||
|
||||
Each log channel has a log level. The log level is set by the `log_level` boot configuration key. The log API will only output log messages with log level equal or higher to current log level. This restriction doesn't apply to log channel `SH_LOG_TEST`.
|
||||
|
||||
@@ -69,7 +70,7 @@ The `sh_log_OUTPUT_SOURCE` type is used to store log source. It's a wrapper of `
|
||||
|
||||
## Output payloads
|
||||
|
||||
In order to compile all of those informations into one payload, the logging API provide this structure :
|
||||
In order to compile all of those informations into one payload, the logging API provides this structure :
|
||||
``` C
|
||||
typedef struct {
|
||||
sh_log_OUTPUT_TYPE output_type;
|
||||
@@ -115,7 +116,7 @@ They all need two arguments in the following order (except `sh_log_ltest` which
|
||||
|
||||
### Logging with formating
|
||||
|
||||
In order to allow for formatting log messages, the log API provide functions named like this:
|
||||
In order to allow for formatting log messages, the log API provides functions named like this:
|
||||
```
|
||||
sh_log_f[test/debug/log/warning/error/critical/fatal]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user