[ulog] support ulog_async_output_enabled

This commit is contained in:
guozhanxin 2023-07-04 13:56:05 +08:00 committed by guo
parent 7b4e52bd79
commit befb15b428
1 changed files with 41 additions and 38 deletions

View File

@ -559,7 +559,8 @@ static void do_output(rt_uint32_t level, const char *tag, rt_bool_t is_raw, cons
{
#ifdef ULOG_USING_ASYNC_OUTPUT
rt_size_t log_buf_size = log_len + sizeof((char)'\0');
if (ulog.async_enabled)
{
if (is_raw == RT_FALSE)
{
rt_rbb_blk_t log_blk;
@ -601,7 +602,10 @@ static void do_output(rt_uint32_t level, const char *tag, rt_bool_t is_raw, cons
/* send a notice */
rt_sem_release(&ulog.async_notice);
}
#else
return;
}
#endif /* ULOG_USING_ASYNC_OUTPUT */
/* is in thread context */
if (rt_interrupt_get_nest() == 0)
{
@ -618,7 +622,6 @@ static void do_output(rt_uint32_t level, const char *tag, rt_bool_t is_raw, cons
ulog_console_backend_output(RT_NULL, level, tag, is_raw, log_buf, log_len);
#endif /* ULOG_BACKEND_USING_CONSOLE */
}
#endif /* ULOG_USING_ASYNC_OUTPUT */
}
/**