diff --git a/code/common/src/logging.h b/code/common/src/logging.h index 1129ad0d..e0364a98 100644 --- a/code/common/src/logging.h +++ b/code/common/src/logging.h @@ -73,6 +73,7 @@ extern uint8_t g_log_buf_cur; if(g_log_fp) { \ if (log_id[log_id_].enable) { \ fprintf(g_log_fp, "%s "fmt_, log_format_timestamp(), ##__VA_ARGS__); \ + fflush(g_log_fp); \ }\ } \ if(g_interactive) { \ @@ -98,6 +99,7 @@ extern uint8_t g_log_buf_cur; if(g_log_fp) { \ if (log_id[log_id_].enable) { \ fprintf(g_log_fp, "%s "fmt_, log_format_timestamp()); \ + fflush(g_log_fp); \ }\ } \ if(g_interactive) { \ @@ -124,6 +126,7 @@ extern uint8_t g_log_buf_cur; if(g_log_fp) { \ if (log_id[log_id_].enable) { \ fprintf(g_log_fp, "%s "fmt_, log_format_timestamp(), ##__VA_ARGS__); \ + fflush(g_log_fp); \ }\ } else { \ if (log_id[log_id_].enable) { \ @@ -137,6 +140,7 @@ extern uint8_t g_log_buf_cur; if(g_log_fp) { \ if (log_id[log_id_].enable) { \ fprintf(g_log_fp, "%s "fmt_, log_format_timestamp()); \ + fflush(g_log_fp); \ }\ } else { \ if (log_id[log_id_].enable) { \ @@ -166,4 +170,4 @@ log_format_timestamp(void); char * log_usage(); -#endif \ No newline at end of file +#endif