• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 "softbus_adapter_log.h"
17 
SoftBusOutPrint(const char * buf,SoftBusLogLevel level)18 void SoftBusOutPrint(const char *buf, SoftBusLogLevel level)
19 {
20 #ifdef SOFTBUS_PRINTF
21     printf("%s\n", buf);
22     return;
23 #endif
24     switch (level) {
25         case SOFTBUS_LOG_DBG:
26             HILOG_DEBUG(SOFTBUS_HILOG_ID, "%{public}s", buf);
27             break;
28         case SOFTBUS_LOG_INFO:
29             HILOG_INFO(SOFTBUS_HILOG_ID, "%{public}s", buf);
30             break;
31         case SOFTBUS_LOG_WARN:
32             HILOG_WARN(SOFTBUS_HILOG_ID, "%{public}s", buf);
33             break;
34         case SOFTBUS_LOG_ERROR:
35             HILOG_ERROR(SOFTBUS_HILOG_ID, "%{public}s", buf);
36             break;
37         default:
38             break;
39     }
40 }