px4_log: flush each line

Without this fix all PX4 output is buffered and presented at the very
end of a scripted MAVSDK test which makes the log hard to read.
This commit is contained in:
Julian Oes 2020-05-20 14:22:14 +02:00
parent 76750fc8a6
commit 1cb706c411
1 changed files with 6 additions and 0 deletions

View File

@ -136,6 +136,12 @@ __EXPORT void px4_log_modulename(int level, const char *moduleName, const char *
orb_publish(ORB_ID(log_message), orb_log_message_pub, &log_message);
}
#ifdef CONFIG_ARCH_BOARD_PX4_SITL
// Without flushing it's tricky to see stdout output when PX4 is started by
// a script like for the MAVSDK tests.
fflush(out);
#endif
}
__EXPORT void px4_log_raw(int level, const char *fmt, ...)