Skip to content

Commit e94e0c9

Browse files
committed
kernel: move to new logger
Signed-off-by: Anas Nashif <[email protected]>
1 parent e0f1d77 commit e94e0c9

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

kernel/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
menu "General Kernel Options"
1111

12+
module = KERNEL
13+
module-str = kernel
14+
source "subsys/logging/Kconfig.template.log_config"
15+
1216
config MULTITHREADING
1317
bool "Multi-threading"
1418
default y

kernel/init.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#include <logging/log_ctrl.h>
3434
#include <tracing.h>
3535

36+
#define LOG_LEVEL CONFIG_KERNEL_LOG_LEVEL
37+
#include <logging/log.h>
38+
LOG_MODULE_REGISTER(kernel);
39+
3640
/* kernel build timestamp items */
3741
#define BUILD_TIMESTAMP "BUILD: " __DATE__ " " __TIME__
3842

kernel/userspace.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
#include <syscall_handler.h>
1717
#include <device.h>
1818
#include <init.h>
19-
#include <logging/sys_log.h>
19+
20+
#define LOG_LEVEL CONFIG_KERNEL_LOG_LEVEL
21+
#include <logging/log.h>
22+
LOG_MODULE_DECLARE(kernel);
23+
2024
#if defined(CONFIG_NETWORKING) && defined (CONFIG_DYNAMIC_OBJECTS)
2125
/* Used by auto-generated obj_size_get() switch body, as we need to
2226
* know the size of struct net_context
@@ -221,7 +225,7 @@ void *_impl_k_object_alloc(enum k_objects otype)
221225

222226
dyn_obj = z_thread_malloc(sizeof(*dyn_obj) + obj_size_get(otype));
223227
if (!dyn_obj) {
224-
SYS_LOG_WRN("could not allocate kernel object");
228+
LOG_WRN("could not allocate kernel object");
225229
return NULL;
226230
}
227231

0 commit comments

Comments
 (0)