We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本:EasyLogger V2.0.0 is initialize success
ElogErrCode elog_init(void) { ...... #ifdef ELOG_COLOR_ENABLE /* disable text color by default / elog_set_text_color_enabled(false); #endif ...... } void elog_output(...) { #ifdef ELOG_COLOR_ENABLE / add CSI start sign and color info */ if (elog.text_color_enabled) { log_len += elog_strcpy(log_len, log_buf + log_len, CSI_START); log_len += elog_strcpy(log_len, log_buf + log_len, color_output_info[level]); } #endif }
这里默认是disable的,但是elog_find_lvl里没有判断text_color_enable,导致获取不到正确的lvl。
int8_t elog_find_lvl(const char log) { #ifdef ELOG_COLOR_ENABLE uint8_t i; size_t csi_start_len = strlen(CSI_START); for(i = 0; i < ELOG_LVL_TOTAL_NUM; i ++) { if (!strncmp(color_output_info[i], log + csi_start_len, strlen(color_output_info[i]))) { return i; } } / found failed */ return -1; #else ... }
The text was updated successfully, but these errors were encountered:
欢迎提交 pr 哈
Sorry, something went wrong.
发现打开颜色后,因为log会出现被截断的情况,导致vt码没有被关闭,后续的打印就都有颜色了
欢迎提交 pr 哈 发现打开颜色后,因为log会出现被截断的情况,导致vt码没有被关闭,后续的打印就都有颜色了
截图看一下?正常截断后的第二条就会自动恢复
欢迎提交 pr 哈 发现打开颜色后,因为log会出现被截断的情况,导致vt码没有被关闭,后续的打印就都有颜色了 截图看一下?正常截断后的第二条就会自动恢复
这个是使用BUF_MODE时,log会被截断写入,然后断电导致后面部分没写入,就会在elog_flash read时出现不完整的log,vt吗也没有被关掉,所以后面就有了颜色。
如果在elog_flash_write这里,判断可以写入的时候,先把前面完整的log先写入,再把本次的log先缓存,这样就不会出现这个问题了
No branches or pull requests
版本:EasyLogger V2.0.0 is initialize success
ElogErrCode elog_init(void) {
......
#ifdef ELOG_COLOR_ENABLE
/* disable text color by default /
elog_set_text_color_enabled(false);
#endif
......
}
void elog_output(...)
{
#ifdef ELOG_COLOR_ENABLE
/ add CSI start sign and color info */
if (elog.text_color_enabled) {
log_len += elog_strcpy(log_len, log_buf + log_len, CSI_START);
log_len += elog_strcpy(log_len, log_buf + log_len, color_output_info[level]);
}
#endif
}
这里默认是disable的,但是elog_find_lvl里没有判断text_color_enable,导致获取不到正确的lvl。
int8_t elog_find_lvl(const char log) {
#ifdef ELOG_COLOR_ENABLE
uint8_t i;
size_t csi_start_len = strlen(CSI_START);
for(i = 0; i < ELOG_LVL_TOTAL_NUM; i ++) {
if (!strncmp(color_output_info[i], log + csi_start_len, strlen(color_output_info[i]))) {
return i;
}
}
/ found failed */
return -1;
#else
...
}
The text was updated successfully, but these errors were encountered: