From 63fa9fe41fb9b973f333f66ce9cdb56acb5dc150 Mon Sep 17 00:00:00 2001 From: wdfk-prog <1425075683@qq.com> Date: Fri, 31 Oct 2025 13:57:30 +0800 Subject: [PATCH] =?UTF-8?q?feat[ulog]:=20=E5=A2=9E=E5=8A=A0=20Kconfig=20?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E4=BB=A5=E6=8E=A7=E5=88=B6=20Finsh/MSH=20?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/utilities/Kconfig | 8 ++++++++ components/utilities/ulog/ulog.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/utilities/Kconfig b/components/utilities/Kconfig index abd7c239940..bffc381c748 100644 --- a/components/utilities/Kconfig +++ b/components/utilities/Kconfig @@ -192,6 +192,14 @@ menuconfig RT_USING_ULOG It will enable the log filter. Such as level filter, log tag filter, log kw filter and tag's level filter. + config ULOG_USING_FINSH_CMD + bool "Enable ulog finsh/msh commands" + depends on ULOG_USING_FILTER && RT_USING_FINSH + default y + help + Enable this option to use ulog commands in finsh/msh, + such as ulog_lvl, ulog_tag, ulog_kw and so on. + config ULOG_USING_SYSLOG bool "Enable syslog format log and API." select ULOG_OUTPUT_TIME diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c index 52ca55de106..1a589e6a627 100644 --- a/components/utilities/ulog/ulog.c +++ b/components/utilities/ulog/ulog.c @@ -1084,7 +1084,7 @@ const char *ulog_global_filter_kw_get(void) return ulog.filter.keyword; } -#ifdef RT_USING_FINSH +#if defined(RT_USING_FINSH) && defined(ULOG_USING_FINSH_CMD) #include static void _print_lvl_info(void) @@ -1259,7 +1259,7 @@ static void ulog_filter(uint8_t argc, char **argv) } } MSH_CMD_EXPORT(ulog_filter, Show ulog filter settings); -#endif /* RT_USING_FINSH */ +#endif /* RT_USING_FINSH && ULOG_USING_FINSH_CMD */ #endif /* ULOG_USING_FILTER */ /**