Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
acfe61b5
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看板
提交
acfe61b5
编写于
11月 09, 2018
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[component][ulog] Fix some comments.
上级
6a165e5c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
10 deletion
+12
-10
components/utilities/ulog/ulog.c
components/utilities/ulog/ulog.c
+12
-10
未找到文件。
components/utilities/ulog/ulog.c
浏览文件 @
acfe61b5
...
...
@@ -750,8 +750,9 @@ void ulog_hexdump(const char *tag, rt_size_t width, rt_uint8_t *buf, rt_size_t s
* When the level is LOG_FILTER_LVL_ALL, it will remove this tag's level filer.
* Then all level log will resume output.
*
* @return 0: success
* -5: no memory
* @return 0 : success
* -5 : no memory
* -10: level is out of range
*/
int
ulog_tag_lvl_filter_set
(
const
char
*
tag
,
rt_uint32_t
level
)
{
...
...
@@ -759,7 +760,8 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
ulog_tag_lvl_filter_t
tag_lvl
=
NULL
;
int
result
=
RT_EOK
;
RT_ASSERT
(
level
<=
LOG_FILTER_LVL_ALL
);
if
(
level
>=
LOG_FILTER_LVL_ALL
)
return
-
RT_EINVAL
;
if
(
!
ulog
.
init_ok
)
return
result
;
...
...
@@ -767,7 +769,7 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
/* lock output */
output_lock
();
/* find the tag in list */
for
(
node
=
rt_slist_first
(
&
ulog
.
filter
.
tag_lvl_list
);
node
;
node
=
rt_slist_next
(
node
))
for
(
node
=
rt_slist_first
(
ulog_tag_lvl_list_get
()
);
node
;
node
=
rt_slist_next
(
node
))
{
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_tag_lvl_filter
,
list
);
if
(
!
rt_strncmp
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
))
...
...
@@ -785,7 +787,7 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
if
(
level
==
LOG_FILTER_LVL_ALL
)
{
/* remove current tag's level filter when input level is the lowest level */
rt_slist_remove
(
&
ulog
.
filter
.
tag_lvl_list
,
&
tag_lvl
->
list
);
rt_slist_remove
(
ulog_tag_lvl_list_get
()
,
&
tag_lvl
->
list
);
rt_free
(
tag_lvl
);
}
else
...
...
@@ -806,7 +808,7 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
rt_memset
(
tag_lvl
->
tag
,
0
,
sizeof
(
tag_lvl
->
tag
));
rt_strncpy
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
);
tag_lvl
->
level
=
level
;
rt_slist_append
(
&
ulog
.
filter
.
tag_lvl_list
,
&
tag_lvl
->
list
);
rt_slist_append
(
ulog_tag_lvl_list_get
()
,
&
tag_lvl
->
list
);
}
else
{
...
...
@@ -840,7 +842,7 @@ rt_uint32_t ulog_tag_lvl_filter_get(const char *tag)
/* lock output */
output_lock
();
/* find the tag in list */
for
(
node
=
rt_slist_first
(
&
ulog
.
filter
.
tag_lvl_list
);
node
;
node
=
rt_slist_next
(
node
))
for
(
node
=
rt_slist_first
(
ulog_tag_lvl_list_get
()
);
node
;
node
=
rt_slist_next
(
node
))
{
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_tag_lvl_filter
,
list
);
if
(
!
rt_strncmp
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
))
...
...
@@ -1081,7 +1083,7 @@ static void ulog_filter(uint8_t argc, char **argv)
{
/* lock output */
output_lock
();
/*
find the tag in
list */
/*
show the tag level
list */
for
(
node
=
rt_slist_first
(
ulog_tag_lvl_list_get
());
node
;
node
=
rt_slist_next
(
node
))
{
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_tag_lvl_filter
,
list
);
...
...
@@ -1225,7 +1227,7 @@ int ulog_init(void)
rt_slist_init
(
&
ulog
.
backend_list
);
#ifdef ULOG_USING_FILTER
rt_slist_init
(
&
ulog
.
filter
.
tag_lvl_list
);
rt_slist_init
(
ulog_tag_lvl_list_get
()
);
#endif
#ifdef ULOG_USING_ASYNC_OUTPUT
...
...
@@ -1287,7 +1289,7 @@ void ulog_deinit(void)
/* deinit tag's level filter */
{
ulog_tag_lvl_filter_t
tag_lvl
;
for
(
node
=
rt_slist_first
(
&
ulog
.
filter
.
tag_lvl_list
);
node
;
node
=
rt_slist_next
(
node
))
for
(
node
=
rt_slist_first
(
ulog_tag_lvl_list_get
()
);
node
;
node
=
rt_slist_next
(
node
))
{
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_tag_lvl_filter
,
list
);
rt_free
(
tag_lvl
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录