#include <core.h>
#include <stdarg.h>
Go to the source code of this file.
typedef void(* log_callback) (loglevel_t level, const char *msg) |
Callback handler called when a message is logged.
- Parameters
-
[in] | level | The log level of the message. |
[in] | msg | The null-terminated string containing the logged message. |
Definition at line 36 of file log.h.
A log level indicates the importance of a logged message.
Enumerator |
---|
LOG_CRIT |
Critical error, occurs just prior to crashing.
|
LOG_ERR |
Serious error in software or hardware.
|
LOG_WARNING |
Warning about a significant issue.
|
LOG_INFO |
Informational message.
|
LOG_DEBUG |
Used for kernel debugging.
|
LOG_DEFAULT |
Default kernel logging level.
|
Definition at line 19 of file log.h.
Add a callback handler for log messages.
- Parameters
-
[in] | maxlevel | Issue callback for log calls up to and including this log level. |
[in] | cb | The callback function |
Definition at line 165 of file log.c.
Remove a callback handler for log messages.
- Parameters
-
[in] | cb | The callback function |
Definition at line 176 of file log.c.
Log a message to the kernel log buffer.
- Parameters
-
[in] | level | The importance level of the logged message. |
[in] | str | The null-terminated string to be printed. |
Definition at line 188 of file log.c.
void logf |
( |
loglevel_t |
level, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
Log a printf-formatted message to the kernel log buffer.
- Parameters
-
[in] | level | The importance level of the logged message. |
[in] | format | The null-terminated format string used to format the text to be printed. |
[in] | ... | Variable arguments list to be initialized with va_start. |
Definition at line 195 of file log.c.
Referenced by acpi_init(), read_rsdt(), and read_xsdt().
void logvf |
( |
loglevel_t |
level, |
|
|
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
Log a printf-formatted string using a variable argument list.
- Parameters
-
[in] | level | The importance level of the logged message. |
[in] | format | The null-terminated format string used to format the text to be printed. |
[in] | args | Variable arguments list to be initialized with va_start. |
Definition at line 204 of file log.c.
Referenced by logf().