This commit introduces a new Kconfig option SYSLOG_TIMESTAMP_MS to allowconfiguring
syslog timestamps to use milliseconds (ms) instead of the default microseconds (µs).
Key changes:
1. Add CONFIG_SYSLOG_TIMESTAMP_MS boolean Kconfig option (depends on SYSLOG_TIMESTAMP),
default disabled. This option lets users choose between millisecond and microsecond
precision in syslog timestamps.
2. Modify the timestamp format string in nx_vsyslog():
a. When CONFIG_SYSLOG_TIMESTAMP_MS is enabled: Use [%5ju.%03ld] (3 digits for ms).
b. When disabled (default): Retain original [%5ju.%06ld] (6 digits for µs).
3. Adjust the timestamp value calculation:
a. For ms: Divide nanoseconds by NSEC_PER_MSEC (1,000,000) to get millisecond value.
b. For µs (default): Retain division by NSEC_PER_USEC (1,000) for microsecond value.
This enhancement provides flexibility in syslog timestamp precision:
1. Millisecond precision reduces log line length and is sufficient for many use cases.
2. Maintains backward compatibility (microseconds remain the default).
3. The Kconfig dependency ensures the option is only visible when timestamps are enabled.
The change is fully conditional and has no impact on existing behavior unless the new option is explicitly enabled.
Signed-off-by: liwangzhu <liwangzhu@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
Initial implementation of RFC 5424 support (syslog protocol). Allows
users to force-format the syslog output in a RFC 5424 compatible way,
making NuttX systems 'originators' that are able to interface with
syslog 'collectors' and 'relays' (useful for logging to syslog servers).
In addition to regular formatting options for syslog output, users can
also add structured data (currently only timeQuality is implemented,
assuming no sync and no timezone is no known). Facilities and severities
now also follow RFC 5424. Support for additional features (like
more sdata elements, msgid, etc.) will need to be built into the syslog
implementation if desired.
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>
Use the CDCACM as a SYSLOG output device, send message to remote proc.
If there are more than one CDCACM devices, then a device minor number
may also need to be provided. Default: 0
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
syslog_putc() have a lot of duplicate logic with syslog_write().
remove syslog_putc() and reuse syslog_write() to simplify syslog printing.
Signed-off-by: chao an <anchao@lixiang.com>
1.Remove RAMLOG_OVERWRITE option and related code
2.Broadcast the readability to all reader and poller
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
support to control the opening or closing of the specified channel through the syslogmask command at runtime
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
warning: The int symbol SYSLOG_RPMSG_WORK_DELAY (defined at drivers/syslog/Kconfig:274) is being evaluated in a logical context somewhere. It will always evaluate to n.
make: *** [tools/Unix.mk:663: olddefconfig] Error 1
Signed-off-by: chao an <anchao@xiaomi.com>
by ramlog_initbuf();
Algorithm: Scan the entire ramlog buffer, the position of the head
is the first byte is not empty and second byte is empty. The position
of the tail is the first byte is empty and second byte is not empty.
Change-Id: Ieb9161bd670481cd335e9a901287cd5e589f0849
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
N/A
specified the name of remote proc(rpmsg server)
Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>