From 76dcec8f4b2c21342e4514a07fd4138ccca8e7eb Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Fri, 31 Oct 2025 09:33:52 +0800 Subject: [PATCH] Documentation: Add description for early_syslog() Add documentation describing the purpose and behavior of early_syslog(), which provides a minimal logging facility available during early system initialization or system down. Signed-off-by: Chengdong Wang wangchengdong@lixiang.com --- .../components/drivers/special/syslog.rst | 20 +++++++++++++++++++ drivers/syslog/Make.defs | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Documentation/components/drivers/special/syslog.rst b/Documentation/components/drivers/special/syslog.rst index 914b7db7d42..d53639bddfb 100644 --- a/Documentation/components/drivers/special/syslog.rst +++ b/Documentation/components/drivers/special/syslog.rst @@ -67,6 +67,26 @@ The above are all standard interfaces as defined at Those interfaces are available for use by application software. The remaining interfaces discussed in this section are non-standard, OS-internal interfaces. +Early Syslog Interfaces +----------------------- + +Provides a minimal SYSLOG output facility that can be used during the +very early boot phase or when the system is in a down state, before the +full SYSLOG subsystem or scheduler becomes available. + +.. c::function:: void early_syslog(FAR const char *fmt, ...); + + See ``include/nuttx/syslog/syslog.h``. + This function provides basic formatted output similar to printf(), + and writes the resulting characters directly to the low-level output + device via up_putc(). It is primarily intended for debugging or + diagnostic messages in early system contexts, where interrupts may + be disabled and locking mechanisms are not yet available. + + The function automatically appends a newline character ('\n') if + the formatted message does not already end with one, ensuring proper + alignment of log output in serial consoles or early boot traces. + Debug Interfaces ---------------- diff --git a/drivers/syslog/Make.defs b/drivers/syslog/Make.defs index 45e4d6bfa65..127f96d0eac 100644 --- a/drivers/syslog/Make.defs +++ b/drivers/syslog/Make.defs @@ -23,7 +23,7 @@ ############################################################################ # Include SYSLOG Infrastructure -if(CONFIG_ARCH_LOWPUTC) +ifeq ($(CONFIG_ARCH_LOWPUTC),y) CSRCS += syslog_early.c endif