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 #ifndef XTS_ACTS_UTIL_H
17 #define XTS_ACTS_UTIL_H
18
19 #include <stdio.h>
20 #include <stdarg.h>
21
22 // 0 not print, 1 print
23 static int g_xtsDebugLevel = 1;
24
LogPrint(const char * format,...)25 static int LogPrint(const char *format, ...)
26 {
27 int ret = 0;
28 if (g_xtsDebugLevel == 0) {
29 } else {
30 va_list ap;
31 va_start(ap, format);
32 ret = vfprintf(stdout, format, ap);
33 va_end(ap);
34 }
35 return ret;
36 }
37
38 #endif