Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
67e849cd
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
67e849cd
编写于
10月 17, 2022
作者:
C
cheng_jinsong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init set log level
Signed-off-by:
N
cheng_jinsong
<
chengjinsong2@huawei.com
>
上级
20e669a3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
13 deletion
+15
-13
interfaces/innerkits/include/beget_ext.h
interfaces/innerkits/include/beget_ext.h
+1
-0
services/log/init_log.c
services/log/init_log.c
+14
-0
services/modules/init_hook/init_hook.c
services/modules/init_hook/init_hook.c
+0
-13
未找到文件。
interfaces/innerkits/include/beget_ext.h
浏览文件 @
67e849cd
...
@@ -56,6 +56,7 @@ INIT_PUBLIC_API void SetInitLogLevel(InitLogLevel level);
...
@@ -56,6 +56,7 @@ INIT_PUBLIC_API void SetInitLogLevel(InitLogLevel level);
INIT_PUBLIC_API
int
GetInitLogLevel
(
void
);
INIT_PUBLIC_API
int
GetInitLogLevel
(
void
);
INIT_PUBLIC_API
void
SetInitCommLog
(
InitCommLog
logFunc
);
INIT_PUBLIC_API
void
SetInitCommLog
(
InitCommLog
logFunc
);
INIT_PUBLIC_API
void
EnableInitLogFromCmdline
(
void
);
INIT_PUBLIC_API
void
EnableInitLogFromCmdline
(
void
);
INIT_PUBLIC_API
void
InitLogLevelFromPersist
(
void
);
#define STARTUP_LOGV(domain, tag, fmt, ...) \
#define STARTUP_LOGV(domain, tag, fmt, ...) \
StartupLog(INIT_DEBUG, domain, tag, "[%s:%d]" fmt, (FILE_NAME), (__LINE__), ##__VA_ARGS__)
StartupLog(INIT_DEBUG, domain, tag, "[%s:%d]" fmt, (FILE_NAME), (__LINE__), ##__VA_ARGS__)
...
...
services/log/init_log.c
浏览文件 @
67e849cd
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <sys/time.h>
#include <sys/time.h>
#include "init_utils.h"
#include "init_utils.h"
#include "param/init_param.h"
#include "securec.h"
#include "securec.h"
#ifdef OHOS_LITE
#ifdef OHOS_LITE
#ifndef INIT_LOG_INIT
#ifndef INIT_LOG_INIT
...
@@ -172,3 +173,16 @@ INIT_PUBLIC_API void EnableInitLogFromCmdline(void)
...
@@ -172,3 +173,16 @@ INIT_PUBLIC_API void EnableInitLogFromCmdline(void)
SetInitLogLevel
(
logLevel
);
SetInitLogLevel
(
logLevel
);
return
;
return
;
}
}
INIT_PUBLIC_API
void
InitLogLevelFromPersist
(
void
)
{
char
logLevel
[
2
]
=
{
0
};
// 2 is set param "persist.init.debug.loglevel" value length.
uint32_t
len
=
sizeof
(
logLevel
);
int
ret
=
SystemReadParam
(
"persist.init.debug.loglevel"
,
logLevel
,
&
len
);
INIT_INFO_CHECK
(
ret
==
0
,
return
,
"Can not get log level from param, keep the original loglevel."
);
errno
=
0
;
unsigned
int
level
=
(
unsigned
int
)
strtoul
(
logLevel
,
0
,
10
);
// 10 is decimal
INIT_INFO_CHECK
(
errno
==
0
,
return
,
"Failed strtoul %s, err=%d"
,
logLevel
,
errno
);
SetInitLogLevel
(
level
);
return
;
}
services/modules/init_hook/init_hook.c
浏览文件 @
67e849cd
...
@@ -170,19 +170,6 @@ static void DumpServiceHook(void)
...
@@ -170,19 +170,6 @@ static void DumpServiceHook(void)
return
;
return
;
}
}
static
void
InitLogLevelFromPersist
(
void
)
{
char
logLevel
[
2
]
=
{
0
};
// 2 is set param "persist.init.debug.loglevel" value length.
uint32_t
len
=
sizeof
(
logLevel
);
int
ret
=
SystemReadParam
(
"persist.init.debug.loglevel"
,
logLevel
,
&
len
);
INIT_INFO_CHECK
(
ret
==
0
,
return
,
"Can not get log level from param, keep the original loglevel."
);
errno
=
0
;
unsigned
int
level
=
(
unsigned
int
)
strtoul
(
logLevel
,
0
,
10
);
// 10 is decimal
INIT_INFO_CHECK
(
errno
==
0
,
return
,
"Failed strtoul %s, err=%d"
,
logLevel
,
errno
);
SetInitLogLevel
(
level
);
return
;
}
static
int
InitDebugHook
(
const
HOOK_INFO
*
info
,
void
*
cookie
)
static
int
InitDebugHook
(
const
HOOK_INFO
*
info
,
void
*
cookie
)
{
{
UNUSED
(
info
);
UNUSED
(
info
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录