fix: Log fatal force flush

Summary:

Test Plan:
This commit is contained in:
icex2
2024-08-15 11:34:32 +02:00
parent 45d7a29cba
commit 14f534b993
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -86,9 +86,18 @@
* @param ... Additional arguments according to the specified arguments in the
* printf format string
*/
// Additional empty log statement to trigger flush on some sinks.
// Otherwise, the last message might get lost
#define log_fatal(...) \
do { \
_bt_core_log_api.v1.fatal( \
LOG_MODULE, \
"%s:%d: function `%s'", \
__FILE__, \
__LINE__, \
__FUNCTION__); \
_bt_core_log_api.v1.fatal(LOG_MODULE, __VA_ARGS__); \
_bt_core_log_api.v1.fatal(LOG_MODULE, ""); \
abort(); \
} while (0)