mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 21:18:23 +00: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:
parent
138397fe8a
commit
0cd3389459
2 changed files with 12 additions and 0 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue