syslog: add an option to completely disable syslog logic

Add an option to completely disable syslog() and replace it with an empty functions.
This option can be useful for small systems when we don't have any logging support,
but compiler is not able to remove useless code.

This way the final image also won't contain the strings that are present in
syslog() calls when compiler optimization is enabled (for example from /boards
where syslog is often used instead of debug macros).

Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl
2025-03-23 08:44:16 +01:00
committed by Lup Yuen Lee
parent 48af14beca
commit c4f142e45c
5 changed files with 78 additions and 1 deletions
+4
View File
@@ -26,6 +26,10 @@ ifeq ($(CONFIG_SYSLOG),y)
CSRCS += lib_syslog.c lib_setlogmask.c
endif
ifeq ($(CONFIG_SYSLOG_NONE),y)
CSRCS += lib_syslog_none.c
endif
# Add the syslog directory to the build
DEPPATH += --dep-path syslog