drivers/syslog: Prepend Process ID to syslog message

Change-Id: I999045034a29acb06f39710436c06b427c543b00
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2021-01-14 11:55:47 +08:00
parent 138397fe8a
commit 0cd3389459
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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
+6
View File
@@ -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 */