Skip to content

Commit a702763

Browse files
committed
Merge remote-tracking branch 'rtt_gitee/gitee_master'
2 parents a14aee9 + 4907b44 commit a702763

File tree

1 file changed

+3
-2
lines changed
  • components/utilities/ulog

1 file changed

+3
-2
lines changed

components/utilities/ulog/ulog.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is
447447
{
448448
/* recalculate the log start address and log size when backend not supported color */
449449
rt_size_t color_info_len = 0, output_size = size;
450+
char *output_log = log;
450451

451452
if (color_output_info[level] != RT_NULL)
452453
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
455456
{
456457
rt_size_t color_hdr_len = rt_strlen(CSI_START) + color_info_len;
457458

458-
log += color_hdr_len;
459+
output_log += color_hdr_len;
459460
output_size -= (color_hdr_len + (sizeof(CSI_END) - 1));
460461
}
461-
backend->output(backend, level, tag, is_raw, log, output_size);
462+
backend->output(backend, level, tag, is_raw, output_log, output_size);
462463
}
463464
#endif /* !defined(ULOG_USING_COLOR) || defined(ULOG_USING_SYSLOG) */
464465
}

0 commit comments

Comments
 (0)