Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mr_Pangza
rt-thread
提交
d0473071
R
rt-thread
项目概览
Mr_Pangza
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
1
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d0473071
编写于
11月 10, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
11月 10, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1955 from armink/fix_ulog
Fix ulog
上级
def7bd4c
f28b9d83
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
138 addition
and
34 deletion
+138
-34
components/utilities/Kconfig
components/utilities/Kconfig
+1
-1
components/utilities/ulog/ulog.c
components/utilities/ulog/ulog.c
+122
-31
components/utilities/ulog/ulog.h
components/utilities/ulog/ulog.h
+6
-2
components/utilities/ulog/ulog_def.h
components/utilities/ulog/ulog_def.h
+9
-0
未找到文件。
components/utilities/Kconfig
浏览文件 @
d0473071
...
@@ -225,7 +225,7 @@ config RT_USING_ULOG
...
@@ -225,7 +225,7 @@ config RT_USING_ULOG
config ULOG_SW_VERSION_NUM
config ULOG_SW_VERSION_NUM
hex
hex
default 0x0010
0
default 0x0010
1
help
help
sfotware module version number
sfotware module version number
endif
endif
...
...
components/utilities/ulog/ulog.c
浏览文件 @
d0473071
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#endif
#endif
#ifdef ULOG_TIME_USING_TIMESTAMP
#ifdef ULOG_TIME_USING_TIMESTAMP
#include <time.h>
#include <
sys/
time.h>
#endif
#endif
#ifdef ULOG_USING_ASYNC_OUTPUT
#ifdef ULOG_USING_ASYNC_OUTPUT
...
@@ -74,15 +74,6 @@
...
@@ -74,15 +74,6 @@
#error "the log line buffer size must more than 80"
#error "the log line buffer size must more than 80"
#endif
#endif
/* tag's level filter */
struct
tag_lvl_filter
{
char
tag
[
ULOG_FILTER_TAG_MAX_LEN
+
1
];
rt_uint32_t
level
;
rt_slist_t
list
;
};
typedef
struct
tag_lvl_filter
*
tag_lvl_filter_t
;
struct
rt_ulog
struct
rt_ulog
{
{
rt_bool_t
init_ok
;
rt_bool_t
init_ok
;
...
@@ -634,17 +625,17 @@ void ulog_raw(const char *format, ...)
...
@@ -634,17 +625,17 @@ void ulog_raw(const char *format, ...)
/**
/**
* dump the hex format data to log
* 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 width hex number for every line, such as: 16, 32
* @param buf hex buffer
* @param buf hex buffer
* @param size buffer size
* @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 - ' ')
#define __is_print(ch) ((unsigned int)((ch) - ' ') < 127u - ' ')
rt_size_t
i
,
j
;
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
];
char
*
log_buf
=
NULL
,
dump_string
[
8
];
int
fmt_result
;
int
fmt_result
;
...
@@ -653,7 +644,7 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
...
@@ -653,7 +644,7 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
#ifdef ULOG_USING_FILTER
#ifdef ULOG_USING_FILTER
/* level filter */
/* level filter */
#ifndef ULOG_USING_SYSLOG
#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
;
return
;
}
}
...
@@ -663,6 +654,11 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
...
@@ -663,6 +654,11 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
return
;
return
;
}
}
#endif
/* ULOG_USING_SYSLOG */
#endif
/* ULOG_USING_SYSLOG */
else
if
(
!
rt_strstr
(
tag
,
ulog
.
filter
.
tag
))
{
/* tag filter */
return
;
}
#endif
/* ULOG_USING_FILTER */
#endif
/* ULOG_USING_FILTER */
/* get log buffer */
/* get log buffer */
...
@@ -677,7 +673,7 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
...
@@ -677,7 +673,7 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
if
(
i
==
0
)
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
,
"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
,
": "
);
log_len
+=
ulog_strcpy
(
log_len
,
log_buf
+
log_len
,
": "
);
}
}
else
else
...
@@ -754,16 +750,18 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
...
@@ -754,16 +750,18 @@ void ulog_hexdump(const char *name, rt_size_t width, rt_uint8_t *buf, rt_size_t
* When the level is LOG_FILTER_LVL_ALL, it will remove this tag's level filer.
* When the level is LOG_FILTER_LVL_ALL, it will remove this tag's level filer.
* Then all level log will resume output.
* Then all level log will resume output.
*
*
* @return 0: success
* @return 0 : success
* -5: no memory
* -5 : no memory
* -10: level is out of range
*/
*/
int
ulog_tag_lvl_filter_set
(
const
char
*
tag
,
rt_uint32_t
level
)
int
ulog_tag_lvl_filter_set
(
const
char
*
tag
,
rt_uint32_t
level
)
{
{
rt_slist_t
*
node
;
rt_slist_t
*
node
;
tag_lvl_filter_t
tag_lvl
=
NULL
;
ulog_
tag_lvl_filter_t
tag_lvl
=
NULL
;
int
result
=
RT_EOK
;
int
result
=
RT_EOK
;
RT_ASSERT
(
level
<=
LOG_FILTER_LVL_ALL
);
if
(
level
>=
LOG_FILTER_LVL_ALL
)
return
-
RT_EINVAL
;
if
(
!
ulog
.
init_ok
)
if
(
!
ulog
.
init_ok
)
return
result
;
return
result
;
...
@@ -771,9 +769,9 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
...
@@ -771,9 +769,9 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
/* lock output */
/* lock output */
output_lock
();
output_lock
();
/* find the tag in list */
/* 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
tag_lvl_filter
,
list
);
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_
tag_lvl_filter
,
list
);
if
(
!
rt_strncmp
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
))
if
(
!
rt_strncmp
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
))
{
{
break
;
break
;
...
@@ -789,7 +787,8 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
...
@@ -789,7 +787,8 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
if
(
level
==
LOG_FILTER_LVL_ALL
)
if
(
level
==
LOG_FILTER_LVL_ALL
)
{
{
/* remove current tag's level filter when input level is the lowest level */
/* 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
else
{
{
...
@@ -803,13 +802,13 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
...
@@ -803,13 +802,13 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
if
(
level
!=
LOG_FILTER_LVL_ALL
)
if
(
level
!=
LOG_FILTER_LVL_ALL
)
{
{
/* new a tag's level filter */
/* new a tag's level filter */
tag_lvl
=
(
tag_lvl_filter_t
)
rt_malloc
(
sizeof
(
struct
tag_lvl_filter
));
tag_lvl
=
(
ulog_tag_lvl_filter_t
)
rt_malloc
(
sizeof
(
struct
ulog_
tag_lvl_filter
));
if
(
tag_lvl
)
if
(
tag_lvl
)
{
{
rt_memset
(
tag_lvl
->
tag
,
0
,
sizeof
(
tag_lvl
->
tag
));
rt_memset
(
tag_lvl
->
tag
,
0
,
sizeof
(
tag_lvl
->
tag
));
rt_strncpy
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
);
rt_strncpy
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
);
tag_lvl
->
level
=
level
;
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
else
{
{
...
@@ -834,7 +833,7 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
...
@@ -834,7 +833,7 @@ int ulog_tag_lvl_filter_set(const char *tag, rt_uint32_t level)
rt_uint32_t
ulog_tag_lvl_filter_get
(
const
char
*
tag
)
rt_uint32_t
ulog_tag_lvl_filter_get
(
const
char
*
tag
)
{
{
rt_slist_t
*
node
;
rt_slist_t
*
node
;
tag_lvl_filter_t
tag_lvl
=
NULL
;
ulog_
tag_lvl_filter_t
tag_lvl
=
NULL
;
rt_uint32_t
level
=
LOG_FILTER_LVL_ALL
;
rt_uint32_t
level
=
LOG_FILTER_LVL_ALL
;
if
(
!
ulog
.
init_ok
)
if
(
!
ulog
.
init_ok
)
...
@@ -843,9 +842,9 @@ rt_uint32_t ulog_tag_lvl_filter_get(const char *tag)
...
@@ -843,9 +842,9 @@ rt_uint32_t ulog_tag_lvl_filter_get(const char *tag)
/* lock output */
/* lock output */
output_lock
();
output_lock
();
/* find the tag in list */
/* 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
tag_lvl_filter
,
list
);
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_
tag_lvl_filter
,
list
);
if
(
!
rt_strncmp
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
))
if
(
!
rt_strncmp
(
tag_lvl
->
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
))
{
{
level
=
tag_lvl
->
level
;
level
=
tag_lvl
->
level
;
...
@@ -858,6 +857,16 @@ rt_uint32_t ulog_tag_lvl_filter_get(const char *tag)
...
@@ -858,6 +857,16 @@ rt_uint32_t ulog_tag_lvl_filter_get(const char *tag)
return
level
;
return
level
;
}
}
/**
* get the tag's level list on filter
*
* @return tag's level list
*/
rt_slist_t
*
ulog_tag_lvl_list_get
(
void
)
{
return
&
ulog
.
filter
.
tag_lvl_list
;
}
/**
/**
* set log global filter level
* set log global filter level
*
*
...
@@ -872,6 +881,18 @@ void ulog_global_filter_lvl_set(rt_uint32_t level)
...
@@ -872,6 +881,18 @@ void ulog_global_filter_lvl_set(rt_uint32_t level)
ulog
.
filter
.
level
=
level
;
ulog
.
filter
.
level
=
level
;
}
}
/**
* get log global filter level
*
* @return log level: LOG_LVL_ASSERT, LOG_LVL_ERROR, LOG_LVL_WARNING, LOG_LVL_INFO, LOG_LVL_DBG
* LOG_FILTER_LVL_SILENT: disable all log output, except assert level
* LOG_FILTER_LVL_ALL: enable all log output
*/
rt_uint32_t
ulog_global_filter_lvl_get
(
void
)
{
return
ulog
.
filter
.
level
;
}
/**
/**
* set log global filter tag
* set log global filter tag
*
*
...
@@ -884,6 +905,16 @@ void ulog_global_filter_tag_set(const char *tag)
...
@@ -884,6 +905,16 @@ void ulog_global_filter_tag_set(const char *tag)
rt_strncpy
(
ulog
.
filter
.
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
);
rt_strncpy
(
ulog
.
filter
.
tag
,
tag
,
ULOG_FILTER_TAG_MAX_LEN
);
}
}
/**
* get log global filter tag
*
* @return tag
*/
const
char
*
ulog_global_filter_tag_get
(
void
)
{
return
ulog
.
filter
.
tag
;
}
/**
/**
* set log global filter keyword
* set log global filter keyword
*
*
...
@@ -896,6 +927,16 @@ void ulog_global_filter_kw_set(const char *keyword)
...
@@ -896,6 +927,16 @@ void ulog_global_filter_kw_set(const char *keyword)
rt_strncpy
(
ulog
.
filter
.
keyword
,
keyword
,
ULOG_FILTER_KW_MAX_LEN
);
rt_strncpy
(
ulog
.
filter
.
keyword
,
keyword
,
ULOG_FILTER_KW_MAX_LEN
);
}
}
/**
* get log global filter keyword
*
* @return keyword
*/
const
char
*
ulog_global_filter_kw_get
(
void
)
{
return
ulog
.
filter
.
keyword
;
}
#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
#include <finsh.h>
#include <finsh.h>
...
@@ -1010,6 +1051,56 @@ static void ulog_kw(uint8_t argc, char **argv)
...
@@ -1010,6 +1051,56 @@ static void ulog_kw(uint8_t argc, char **argv)
}
}
}
}
MSH_CMD_EXPORT
(
ulog_kw
,
Set
ulog
global
filter
keyword
);
MSH_CMD_EXPORT
(
ulog_kw
,
Set
ulog
global
filter
keyword
);
static
void
ulog_filter
(
uint8_t
argc
,
char
**
argv
)
{
#ifndef ULOG_USING_SYSLOG
const
char
*
lvl_name
[]
=
{
"Assert "
,
"Error "
,
"Error "
,
"Error "
,
"Warning"
,
"Info "
,
"Info "
,
"Debug "
};
#endif
const
char
*
tag
=
ulog_global_filter_tag_get
(),
*
kw
=
ulog_global_filter_kw_get
();
rt_slist_t
*
node
;
ulog_tag_lvl_filter_t
tag_lvl
=
NULL
;
rt_kprintf
(
"--------------------------------------
\n
"
);
rt_kprintf
(
"ulog global filter:
\n
"
);
#ifndef ULOG_USING_SYSLOG
rt_kprintf
(
"level : %s
\n
"
,
lvl_name
[
ulog_global_filter_lvl_get
()]);
#else
rt_kprintf
(
"level : %d
\n
"
,
ulog_global_filter_lvl_get
());
#endif
rt_kprintf
(
"tag : %s
\n
"
,
rt_strlen
(
tag
)
==
0
?
"NULL"
:
tag
);
rt_kprintf
(
"keyword : %s
\n
"
,
rt_strlen
(
kw
)
==
0
?
"NULL"
:
kw
);
rt_kprintf
(
"--------------------------------------
\n
"
);
rt_kprintf
(
"ulog tag's level filter:
\n
"
);
if
(
rt_slist_isempty
(
ulog_tag_lvl_list_get
()))
{
rt_kprintf
(
"settings not found
\n
"
);
}
else
{
/* lock output */
output_lock
();
/* 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
);
rt_kprintf
(
"%-*.s: "
,
ULOG_FILTER_TAG_MAX_LEN
,
tag_lvl
->
tag
);
#ifndef ULOG_USING_SYSLOG
rt_kprintf
(
"%s
\n
"
,
lvl_name
[
tag_lvl
->
level
]);
#else
rt_kprintf
(
"%d
\n
"
,
tag_lvl
->
level
);
#endif
}
/* unlock output */
output_unlock
();
}
}
MSH_CMD_EXPORT
(
ulog_filter
,
Show
ulog
filter
settings
);
#endif
/* defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) */
#endif
/* defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) */
#endif
/* ULOG_USING_FILTER */
#endif
/* ULOG_USING_FILTER */
...
@@ -1136,7 +1227,7 @@ int ulog_init(void)
...
@@ -1136,7 +1227,7 @@ int ulog_init(void)
rt_slist_init
(
&
ulog
.
backend_list
);
rt_slist_init
(
&
ulog
.
backend_list
);
#ifdef ULOG_USING_FILTER
#ifdef ULOG_USING_FILTER
rt_slist_init
(
&
ulog
.
filter
.
tag_lvl_list
);
rt_slist_init
(
ulog_tag_lvl_list_get
()
);
#endif
#endif
#ifdef ULOG_USING_ASYNC_OUTPUT
#ifdef ULOG_USING_ASYNC_OUTPUT
...
@@ -1197,10 +1288,10 @@ void ulog_deinit(void)
...
@@ -1197,10 +1288,10 @@ void ulog_deinit(void)
#ifdef ULOG_USING_FILTER
#ifdef ULOG_USING_FILTER
/* deinit tag's level filter */
/* deinit tag's level filter */
{
{
tag_lvl_filter_t
tag_lvl
;
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
tag_lvl_filter
,
list
);
tag_lvl
=
rt_slist_entry
(
node
,
struct
ulog_
tag_lvl_filter
,
list
);
rt_free
(
tag_lvl
);
rt_free
(
tag_lvl
);
}
}
}
}
...
...
components/utilities/ulog/ulog.h
浏览文件 @
d0473071
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#define ULOG_VERSION_STR "0.1.
0
"
#define ULOG_VERSION_STR "0.1.
1
"
/*
/*
* ulog init and deint
* ulog init and deint
...
@@ -58,9 +58,13 @@ rt_err_t ulog_backend_unregister(ulog_backend_t backend);
...
@@ -58,9 +58,13 @@ rt_err_t ulog_backend_unregister(ulog_backend_t backend);
*/
*/
int
ulog_tag_lvl_filter_set
(
const
char
*
tag
,
rt_uint32_t
level
);
int
ulog_tag_lvl_filter_set
(
const
char
*
tag
,
rt_uint32_t
level
);
rt_uint32_t
ulog_tag_lvl_filter_get
(
const
char
*
tag
);
rt_uint32_t
ulog_tag_lvl_filter_get
(
const
char
*
tag
);
rt_slist_t
*
ulog_tag_lvl_list_get
(
void
);
void
ulog_global_filter_lvl_set
(
rt_uint32_t
level
);
void
ulog_global_filter_lvl_set
(
rt_uint32_t
level
);
rt_uint32_t
ulog_global_filter_lvl_get
(
void
);
void
ulog_global_filter_tag_set
(
const
char
*
tag
);
void
ulog_global_filter_tag_set
(
const
char
*
tag
);
const
char
*
ulog_global_filter_tag_get
(
void
);
void
ulog_global_filter_kw_set
(
const
char
*
keyword
);
void
ulog_global_filter_kw_set
(
const
char
*
keyword
);
const
char
*
ulog_global_filter_kw_get
(
void
);
#endif
/* ULOG_USING_FILTER */
#endif
/* ULOG_USING_FILTER */
/*
/*
...
@@ -79,7 +83,7 @@ void ulog_async_waiting_log(rt_int32_t time);
...
@@ -79,7 +83,7 @@ void ulog_async_waiting_log(rt_int32_t time);
/*
/*
* dump the hex format data to log
* 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.
* Another log output API. This API is more difficult to use than LOG_X API.
...
...
components/utilities/ulog/ulog_def.h
浏览文件 @
d0473071
...
@@ -165,6 +165,15 @@ extern "C" {
...
@@ -165,6 +165,15 @@ extern "C" {
#define ULOG_FRAME_MAGIC 0x10
#define ULOG_FRAME_MAGIC 0x10
/* tag's level filter */
struct
ulog_tag_lvl_filter
{
char
tag
[
ULOG_FILTER_TAG_MAX_LEN
+
1
];
rt_uint32_t
level
;
rt_slist_t
list
;
};
typedef
struct
ulog_tag_lvl_filter
*
ulog_tag_lvl_filter_t
;
struct
ulog_frame
struct
ulog_frame
{
{
/* magic word is 0x10 ('lo') */
/* magic word is 0x10 ('lo') */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录