Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
c990f0a0
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c990f0a0
编写于
11月 08, 2018
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[component][ulog] Add tag filter to hexdump function.
上级
2ff67c93
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
6 deletion
+11
-6
components/utilities/ulog/ulog.c
components/utilities/ulog/ulog.c
+10
-5
components/utilities/ulog/ulog.h
components/utilities/ulog/ulog.h
+1
-1
未找到文件。
components/utilities/ulog/ulog.c
浏览文件 @
c990f0a0
...
...
@@ -625,17 +625,17 @@ void ulog_raw(const char *format, ...)
/**
* dump the hex format data to log
*
* @param
name
name for hex object, it will show on log header
* @param
tag
name for hex object, it will show on log header
* @param width hex number for every line, such as: 16, 32
* @param buf hex buffer
* @param size buffer size
*/
void
ulog_hexdump
(
const
char
*
name
,
rt_size_t
width
,
rt_uint8_t
*
buf
,
rt_size_t
size
)
void
ulog_hexdump
(
const
char
*
tag
,
rt_size_t
width
,
rt_uint8_t
*
buf
,
rt_size_t
size
)
{
#define __is_print(ch) ((unsigned int)((ch) - ' ') < 127u - ' ')
rt_size_t
i
,
j
;
rt_size_t
log_len
=
0
,
name_len
=
rt_strlen
(
name
);
rt_size_t
log_len
=
0
,
name_len
=
rt_strlen
(
tag
);
char
*
log_buf
=
NULL
,
dump_string
[
8
];
int
fmt_result
;
...
...
@@ -644,7 +644,7 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
#ifdef ULOG_USING_FILTER
/* level filter */
#ifndef ULOG_USING_SYSLOG
if
(
LOG_LVL_DBG
>
ulog
.
filter
.
level
)
if
(
LOG_LVL_DBG
>
ulog
.
filter
.
level
||
LOG_LVL_DBG
>
ulog_tag_lvl_filter_get
(
tag
)
)
{
return
;
}
...
...
@@ -654,6 +654,11 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
return
;
}
#endif
/* ULOG_USING_SYSLOG */
else
if
(
!
rt_strstr
(
tag
,
ulog
.
filter
.
tag
))
{
/* tag filter */
return
;
}
#endif
/* ULOG_USING_FILTER */
/* get log buffer */
...
...
@@ -668,7 +673,7 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
if
(
i
==
0
)
{
log_len
+=
ulog_strcpy
(
log_len
,
log_buf
+
log_len
,
"D/HEX "
);
log_len
+=
ulog_strcpy
(
log_len
,
log_buf
+
log_len
,
name
);
log_len
+=
ulog_strcpy
(
log_len
,
log_buf
+
log_len
,
tag
);
log_len
+=
ulog_strcpy
(
log_len
,
log_buf
+
log_len
,
": "
);
}
else
...
...
components/utilities/ulog/ulog.h
浏览文件 @
c990f0a0
...
...
@@ -83,7 +83,7 @@ void ulog_async_waiting_log(rt_int32_t time);
/*
* dump the hex format data to log
*/
void
ulog_hexdump
(
const
char
*
name
,
rt_size_t
width
,
rt_uint8_t
*
buf
,
rt_size_t
size
);
void
ulog_hexdump
(
const
char
*
tag
,
rt_size_t
width
,
rt_uint8_t
*
buf
,
rt_size_t
size
);
/*
* Another log output API. This API is more difficult to use than LOG_X API.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录