代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/hiviewdfx_hiview_lite 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "hos_types.h"
#include "hos_init.h"
#include "hiview_log.h"
#include "hiview_config.h"
#include <stdint.h>
HiviewConfig g_hiviewConfig = {
.outputOption = OUTPUT_OPTION_FLOW,
.level = HILOG_LV_DEBUG,
.logSwitch = HIVIEW_FEATURE_ON,
.dumpSwitch = HIVIEW_FEATURE_OFF,
.eventSwitch = HIVIEW_FEATURE_OFF,
};
static void HiviewConfigInit(void)
{
g_hiviewConfig.hiviewInited = FALSE;
g_hiviewConfig.logOutputModule = UINT64_MAX;
g_hiviewConfig.writeFailureCount = 0;
}
CORE_INIT_PRI(HiviewConfigInit, 0);
boolean SetLogLevel(uint8 level)
{
if (level >= HILOG_LV_DEBUG && level < HILOG_MODULE_MAX) {
g_hiviewConfig.level = level;
return TRUE;
}
return FALSE;
}
void SwitchLog(uint8 flag)
{
(flag == HIVIEW_FEATURE_ON) ? (g_hiviewConfig.logSwitch = HIVIEW_FEATURE_ON) :
(g_hiviewConfig.logSwitch = HIVIEW_FEATURE_OFF);
}
void SwitchEvent(uint8 flag)
{
(flag == HIVIEW_FEATURE_ON) ? (g_hiviewConfig.eventSwitch = HIVIEW_FEATURE_ON) :
(g_hiviewConfig.eventSwitch = HIVIEW_FEATURE_OFF);
}
void SwitchDump(uint8 flag)
{
(flag == HIVIEW_FEATURE_ON) ? (g_hiviewConfig.dumpSwitch = HIVIEW_FEATURE_ON) :
(g_hiviewConfig.dumpSwitch = HIVIEW_FEATURE_OFF);
}
boolean OpenLogOutputModule(uint8 mod)
{
if (mod < HILOG_MODULE_MAX) {
g_hiviewConfig.logOutputModule |= (1 << mod);
return TRUE;
}
return FALSE;
}
boolean CloseLogOutputModule(uint8 mod)
{
if (mod < HILOG_MODULE_MAX) {
g_hiviewConfig.logOutputModule &= (~(1 << mod));
return TRUE;
}
return FALSE;
}
boolean SetLogOutputModule(uint8 mod)
{
if (mod < HILOG_MODULE_MAX) {
g_hiviewConfig.logOutputModule &= (1 << mod);
return TRUE;
} else if (mod == HILOG_MODULE_MAX) {
g_hiviewConfig.logOutputModule = UINT64_MAX;
return TRUE;
} else {
return FALSE;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。