1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "log.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
FillpApiSetDebugLogLevel(IN FILLP_UINT8 logLevel)22 FILLP_INT32 FillpApiSetDebugLogLevel(IN FILLP_UINT8 logLevel)
23 {
24     if (logLevel < FILLP_DBG_LVL_DEBUG || logLevel > FILLP_DBG_LVL_ERROR) {
25         return ERR_PARAM;
26     }
27 
28     g_fillpLmGlobal.debugLevel = (FILLP_UINT8)logLevel;
29     return ERR_OK;
30 }
31 
FillpApiConfigLogModules(IN FILLP_ULLONG logModules)32 FILLP_UINT32 FillpApiConfigLogModules(IN FILLP_ULLONG logModules)
33 {
34     g_fillpLmGlobal.logModules = logModules;
35     return ERR_OK;
36 }
37 
FillpApiSetMgtMsgLog(IN FILLP_INT enable)38 FILLP_INT FillpApiSetMgtMsgLog(IN FILLP_INT enable)
39 {
40 #ifdef FILLP_MGT_MSG_LOG
41     g_fillpLmGlobal.mgtMsgLog = !!enable;
42     return ERR_OK;
43 #else
44     FILLP_LOGERR("do not support mgt msg log");
45     FILLP_UNUSED_PARA(enable);
46     return ERR_COMM;
47 #endif
48 }
49 
50 #ifdef __cplusplus
51 }
52 #endif
53