提交 a702763d 编写于 作者: R rtthread-bot

Merge remote-tracking branch 'rtt_gitee/gitee_master'

...@@ -447,6 +447,7 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is ...@@ -447,6 +447,7 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is
{ {
/* recalculate the log start address and log size when backend not supported color */ /* recalculate the log start address and log size when backend not supported color */
rt_size_t color_info_len = 0, output_size = size; rt_size_t color_info_len = 0, output_size = size;
char *output_log = log;
if (color_output_info[level] != RT_NULL) if (color_output_info[level] != RT_NULL)
color_info_len = rt_strlen(color_output_info[level]); color_info_len = rt_strlen(color_output_info[level]);
...@@ -455,10 +456,10 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is ...@@ -455,10 +456,10 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is
{ {
rt_size_t color_hdr_len = rt_strlen(CSI_START) + color_info_len; rt_size_t color_hdr_len = rt_strlen(CSI_START) + color_info_len;
log += color_hdr_len; output_log += color_hdr_len;
output_size -= (color_hdr_len + (sizeof(CSI_END) - 1)); output_size -= (color_hdr_len + (sizeof(CSI_END) - 1));
} }
backend->output(backend, level, tag, is_raw, log, output_size); backend->output(backend, level, tag, is_raw, output_log, output_size);
} }
#endif /* !defined(ULOG_USING_COLOR) || defined(ULOG_USING_SYSLOG) */ #endif /* !defined(ULOG_USING_COLOR) || defined(ULOG_USING_SYSLOG) */
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册