xiaoxiang781216 commented on a change in pull request #5853:
URL: https://github.com/apache/incubator-nuttx/pull/5853#discussion_r836024367
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -130,7 +130,8 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR
va_list *ap)
if (ret > 0)
{
- ret = lib_sprintf(&stream.public, "[%s] ", date_buf);
+ ret = lib_sprintf(&stream.public, "[%s.%06ld] ",
+ date_buf, ts.tv_nsec / 1000);
Review comment:
Do you mean to add a general clock_printf API? my suggestion limit to
the scope of syslog which mean:
1. Add SYSLOG_TIMESTAMP_FORMAT_MICROSECOND which depend on
SYSLOG_TIMESTAMP_FORMAT
2. Guard the microsecond log by SYSLOG_TIMESTAMP_FORMAT_MICROSECOND
And SYSLOG_TIMESTAMP_FORMAT_MICROSECOND default to y since
SYSLOG_TIMESTAMP_FORMAT is "%e/%m/%y %H:%M:%S" which is good to append
microsecond.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]