Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
9d3af38b
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
大约 1 年 前同步成功
通知
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9d3af38b
编写于
10月 20, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1408 调整 init log 不对外开放的接口改为 INIT_LOCAL_API
Merge pull request !1408 from cheng_jinsong/init1020
上级
1e259e92
2d15ff46
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
15 addition
and
19 deletion
+15
-19
interfaces/innerkits/include/beget_ext.h
interfaces/innerkits/include/beget_ext.h
+0
-5
services/begetctl/setloglevel.c
services/begetctl/setloglevel.c
+3
-2
services/log/init_commlog.c
services/log/init_commlog.c
+1
-1
services/log/init_log.c
services/log/init_log.c
+2
-7
services/log/init_log.h
services/log/init_log.h
+5
-0
services/param/linux/param_request.c
services/param/linux/param_request.c
+0
-2
services/param/liteos/param_client.c
services/param/liteos/param_client.c
+1
-0
services/param/liteos/param_service.c
services/param/liteos/param_service.c
+1
-0
test/unittest/lite/cmd_func_test.cpp
test/unittest/lite/cmd_func_test.cpp
+1
-1
test/unittest/param/param_stub.cpp
test/unittest/param/param_stub.cpp
+1
-1
未找到文件。
interfaces/innerkits/include/beget_ext.h
浏览文件 @
9d3af38b
...
...
@@ -49,15 +49,10 @@ typedef enum InitLogLevel {
INIT_FATAL
}
InitLogLevel
;
typedef
void
(
*
InitCommLog
)(
int
logLevel
,
uint32_t
domain
,
const
char
*
tag
,
const
char
*
fmt
,
va_list
vargs
);
#define FILE_NAME (strrchr((__FILE__), '/') ? strrchr((__FILE__), '/') + 1 : (__FILE__))
INIT_PUBLIC_API
void
StartupLog
(
InitLogLevel
logLevel
,
uint32_t
domain
,
const
char
*
tag
,
const
char
*
fmt
,
...);
INIT_PUBLIC_API
void
EnableInitLog
(
InitLogLevel
level
);
INIT_PUBLIC_API
void
SetInitLogLevel
(
InitLogLevel
level
);
INIT_PUBLIC_API
int
GetInitLogLevel
(
void
);
INIT_PUBLIC_API
void
SetInitCommLog
(
InitCommLog
logFunc
);
INIT_PUBLIC_API
void
EnableInitLogFromCmdline
(
void
);
#define STARTUP_LOGV(domain, tag, fmt, ...) \
StartupLog(INIT_DEBUG, domain, tag, "[%s:%d]" fmt, (FILE_NAME), (__LINE__), ##__VA_ARGS__)
...
...
services/begetctl/setloglevel.c
浏览文件 @
9d3af38b
...
...
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include "begetctl.h"
#include "init_log.h"
#include "init_utils.h"
#include "init_param.h"
#include "securec.h"
...
...
@@ -53,9 +54,9 @@ static int32_t GetInitLogLevelFromParam(BShellHandle shell, int argc, char **arg
uint32_t
len
=
sizeof
(
logLevel
);
int
ret
=
SystemReadParam
(
"persist.init.debug.loglevel"
,
logLevel
,
&
len
);
if
(
ret
==
0
)
{
printf
(
"Success to get init log level: %s from param
\"
persist.init.debug.loglevel
\"
\n
"
,
logLevel
);
printf
(
"Success to get init log level: %s from param
\"
persist.init.debug.loglevel
\"
.
\n
"
,
logLevel
);
}
else
{
printf
(
"Failed to get init log level from param, keep the system origin log level
: %d.
\n
"
,
GetInitLogLevel
()
);
printf
(
"Failed to get init log level from param, keep the system origin log level
.
\n
"
);
}
return
0
;
}
...
...
services/log/init_commlog.c
浏览文件 @
9d3af38b
...
...
@@ -16,7 +16,7 @@
#include "init_log.h"
static
InitCommLog
g_initCommLog
=
NULL
;
INIT_
PUBLIC
_API
void
SetInitCommLog
(
InitCommLog
logFunc
)
INIT_
LOCAL
_API
void
SetInitCommLog
(
InitCommLog
logFunc
)
{
g_initCommLog
=
logFunc
;
}
...
...
services/log/init_log.c
浏览文件 @
9d3af38b
...
...
@@ -140,18 +140,13 @@ INIT_PUBLIC_API void SetInitLogLevel(InitLogLevel level)
return
;
}
INIT_PUBLIC_API
int
GetInitLogLevel
(
void
)
{
return
g_logLevel
;
}
INIT_PUBLIC_API
void
EnableInitLog
(
InitLogLevel
level
)
INIT_LOCAL_API
void
EnableInitLog
(
InitLogLevel
level
)
{
g_logLevel
=
level
;
SetInitCommLog
(
InitLog
);
}
INIT_
PUBLIC
_API
void
EnableInitLogFromCmdline
(
void
)
INIT_
LOCAL
_API
void
EnableInitLogFromCmdline
(
void
)
{
SetInitCommLog
(
InitLog
);
char
level
[
MAX_BUFFER_LEN
]
=
{
0
};
...
...
services/log/init_log.h
浏览文件 @
9d3af38b
...
...
@@ -36,8 +36,13 @@ extern "C" {
#define INIT_LOG_DOMAIN (BASE_DOMAIN + 1)
#endif
typedef
void
(
*
InitCommLog
)(
int
logLevel
,
uint32_t
domain
,
const
char
*
tag
,
const
char
*
fmt
,
va_list
vargs
);
INIT_LOCAL_API
void
OpenLogDevice
(
void
);
INIT_LOCAL_API
void
InitLog
(
int
logLevel
,
unsigned
int
domain
,
const
char
*
tag
,
const
char
*
fmt
,
va_list
vargs
);
INIT_LOCAL_API
void
SetInitCommLog
(
InitCommLog
logFunc
);
INIT_LOCAL_API
void
EnableInitLog
(
InitLogLevel
level
);
INIT_LOCAL_API
void
EnableInitLogFromCmdline
(
void
);
#ifdef PARAM_BASE
#define INIT_LOGV(fmt, ...)
...
...
services/param/linux/param_request.c
浏览文件 @
9d3af38b
...
...
@@ -21,9 +21,7 @@
#include <sys/socket.h>
#include <unistd.h>
#ifdef PARAM_BASE_LOG
#include "init_log.h"
#endif
#include "init_utils.h"
#include "param_base.h"
#include "param_manager.h"
...
...
services/param/liteos/param_client.c
浏览文件 @
9d3af38b
...
...
@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "init_log.h"
#include "init_param.h"
#include "param_manager.h"
...
...
services/param/liteos/param_service.c
浏览文件 @
9d3af38b
...
...
@@ -15,6 +15,7 @@
#include <errno.h>
#include <unistd.h>
#include "init_log.h"
#include "init_param.h"
#include "init_utils.h"
#include "param_manager.h"
...
...
test/unittest/lite/cmd_func_test.cpp
浏览文件 @
9d3af38b
...
...
@@ -21,10 +21,10 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "beget_ext.h"
#include "cJSON.h"
#include "init_cmds.h"
#include "init_jobs_internal.h"
#include "init_log.h"
#include "init_service_manager.h"
#include "param_stub.h"
#include "securec.h"
...
...
test/unittest/param/param_stub.cpp
浏览文件 @
9d3af38b
...
...
@@ -15,7 +15,7 @@
#include "param_stub.h"
#include <dirent.h>
#include "
beget_ext
.h"
#include "
init_log
.h"
#include "init_param.h"
#include "param_manager.h"
#include "param_security.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录