BugID:19020013: Fix sync log disorder problem
@@ -74,6 +74,7 @@ int rt_log(const unsigned char s, const char* mod, const char* f, const unsigned
if (log_init && s < stop_filter_level) {
va_list args;
long long ms = aos_now_ms();
+ if (log_get_mutex()) {
if ((mod == NULL) || (0 == strlen(mod))) {
printf("%s [%4d.%03d]<%c> [%s#%d] : ", log_col_def[s], (int)(ms / 1000), (int)(ms % 1000), serverity_name[s], f, l);
} else {
@@ -87,6 +88,7 @@ int rt_log(const unsigned char s, const char* mod, const char* f, const unsigned
printf("\r\n");
log_release_mutex();
}
+ }
return rc;
}
@@ -96,6 +98,8 @@ int rt_log(const unsigned char s, const char *fmt, ...)
{
int rc = -1;
if (log_init && s < stop_filter_level) {
+
+ if (log_get_mutex()) {
va_list args;
printf("[%06d]<%c> ", (int)aos_now_ms(), serverity_name[s]);
@@ -107,6 +111,7 @@ int rt_log(const unsigned char s, const char *fmt, ...)
printf("\r\n");
log_release_mutex();
}
+ }
return rc;
}
