This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 925efc2314b86e832233bb5da1f9ffc8246d5072 Author: dongjiuzhu1 <[email protected]> AuthorDate: Sat Jun 15 16:38:00 2024 +0800 system/uORB: using lib_sprintf to output va_format and printf normal info in aosp adb shell Signed-off-by: dongjiuzhu1 <[email protected]> --- system/uorb/uORB/uORB.c | 6 +++++- system/uorb/uORB/uORB.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c index d979277cb..67bf6461b 100644 --- a/system/uorb/uORB/uORB.c +++ b/system/uorb/uORB/uORB.c @@ -348,11 +348,15 @@ int orb_sscanf(FAR const char *buf, FAR const char *format, FAR void *data) void orb_info(FAR const char *format, FAR const char *name, FAR const void *data) { + struct lib_stdoutstream_s stdoutstream; struct va_format vaf; vaf.fmt = format; vaf.va = (va_list *)data; - uorbinfo_raw("%s(now:%" PRIu64 "):%pB\n", name, orb_absolute_time(), &vaf); + + lib_stdoutstream(&stdoutstream, stdout); + lib_sprintf(&stdoutstream.common, "%s(now:%" PRIu64 "):%pB", + name, orb_absolute_time(), &vaf); } int orb_fprintf(FAR FILE *stream, FAR const char *format, diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index 1db6e78c2..a4ccf35dc 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -156,7 +156,7 @@ struct orb_handle_s # define uorbdebug uorbnone #endif -#define uorbinfo_raw(fmt, ...) syslog(LOG_INFO, fmt "\n", ##__VA_ARGS__) +#define uorbinfo_raw(fmt, ...) printf(fmt "\n", ##__VA_ARGS__) /* Generates a pointer to the uORB metadata structure for * a given topic.
