未验证 提交 89286963 编写于 作者: O openharmony_ci 提交者: Gitee

!1708 FIX:增加开关显式控制是否记日志

Merge pull request !1708 from cheng_jinsong/0118_PR
......@@ -37,6 +37,9 @@ declare_args() {
startup_init_test_performance = true
# log display control
config_ohos_startup_init_lite_no_log = false
startup_init_with_param_base = false
if (!use_musl) {
startup_init_with_param_base = true
......
......@@ -98,15 +98,9 @@ void LogToDmesg(InitLogLevel logLevel, const char *tag, const char *info)
static void PrintLog(InitLogLevel logLevel, unsigned int domain, const char *tag, const char *logInfo)
{
#ifdef OHOS_LITE
#ifdef __LITEOS_M__
(void)logLevel;
(void)domain;
printf("[%s]%s \n", tag, logInfo);
#else
static const LogLevel LOG_LEVEL[] = { LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_FATAL };
(void)HiLogPrint(INIT_LOG_INIT, LOG_LEVEL[logLevel], domain, tag, "%{public}s", logInfo);
#endif
#endif
#ifdef INIT_DMESG
LogToDmesg(logLevel, tag, logInfo);
#endif
......
......@@ -44,7 +44,7 @@ INIT_LOCAL_API void SetInitCommLog(InitCommLog logFunc);
INIT_LOCAL_API void EnableInitLog(InitLogLevel level);
INIT_LOCAL_API void EnableInitLogFromCmdline(void);
#ifdef PARAM_BASE
#if defined(INIT_NO_LOG) || defined(PARAM_BASE)
#define INIT_LOGV(fmt, ...)
#define INIT_LOGI(fmt, ...)
#define INIT_LOGW(fmt, ...)
......
......@@ -115,6 +115,10 @@ static_library("param_client_lite") {
defines = param_build_defines
public_configs = [ ":exported_header_files" ]
if (config_ohos_startup_init_lite_no_log) {
defines += [ "INIT_NO_LOG" ]
}
if (ohos_kernel_type == "liteos_a") {
sources +=
[ "//base/startup/init/services/param/adapter/param_persistadp.c" ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册