mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
drivers/syslog: Prepend Process ID to syslog message
Change-Id: I999045034a29acb06f39710436c06b427c543b00 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -111,6 +111,12 @@ config SYSLOG_TIMESTAMP_REALTIME
|
||||
CLOCK_MONOTONIC, if enabled, will be used or the system timer
|
||||
is not.
|
||||
|
||||
config SYSLOG_PROCESSID
|
||||
bool "Prepend Process ID to syslog message"
|
||||
default n
|
||||
---help---
|
||||
Prepend Process ID to syslog message.
|
||||
|
||||
config SYSLOG_PREFIX
|
||||
bool "Prepend prefix to syslog message"
|
||||
default n
|
||||
|
||||
@@ -138,6 +138,12 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
|
||||
ret = 0;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SYSLOG_PROCESSID)
|
||||
/* Pre-pend the Process ID */
|
||||
|
||||
ret += lib_sprintf(&stream.public, "[%2d] ", (int)getpid());
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SYSLOG_PREFIX)
|
||||
/* Pre-pend the prefix, if available */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user