Commit 7c7f36f8 authored by Johan Hedberg's avatar Johan Hedberg Committed by Anas Nashif
Browse files

sys_log: Remove option of mapping to printf



Having the logging macros arbitrarily mapping to printk or printf
based on selected Kconfig options that the app isn't necessarily aware
of can have unexpeced (bad) side effects. In particular, printf
consumes *a lot* more stack (closer to 512 bytes) than printk, so
enabling a seemingly innocent CONFIG_STDOUT_CONSOLE option could lead
to stack overflows that are hard to debug.

Jira: ZEP-1419

Change-Id: I5fd77a7ed402e9ca67af23857e0f886f96d243bc
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 9aafa973
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -55,13 +55,10 @@ void syslog_hook_install(void (*hook)(const char *, ...));
/* decide print func */
#if defined(CONFIG_SYS_LOG_EXT_HOOK)
#define SYS_LOG_BACKEND_FN syslog_hook
#elif defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define SYS_LOG_BACKEND_FN printf
#else
#include <misc/printk.h>
#define SYS_LOG_BACKEND_FN printk
#endif /* CONFIG_STDOUT_CONSOLE */
#endif

/* Should use color? */
#if defined(CONFIG_SYS_LOG_SHOW_COLOR)