1ca0551cfSopenharmony_ci/*
2ca0551cfSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3ca0551cfSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4ca0551cfSopenharmony_ci * you may not use this file except in compliance with the License.
5ca0551cfSopenharmony_ci * You may obtain a copy of the License at
6ca0551cfSopenharmony_ci *
7ca0551cfSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8ca0551cfSopenharmony_ci *
9ca0551cfSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10ca0551cfSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11ca0551cfSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12ca0551cfSopenharmony_ci * See the License for the specific language governing permissions and
13ca0551cfSopenharmony_ci * limitations under the License.
14ca0551cfSopenharmony_ci */
15ca0551cfSopenharmony_ci
16ca0551cfSopenharmony_ci#ifndef OHOS_IDL_LOGGER_H
17ca0551cfSopenharmony_ci#define OHOS_IDL_LOGGER_H
18ca0551cfSopenharmony_ci
19ca0551cfSopenharmony_ci#include <cstdarg>
20ca0551cfSopenharmony_ci
21ca0551cfSopenharmony_cinamespace OHOS {
22ca0551cfSopenharmony_cinamespace Idl {
23ca0551cfSopenharmony_ciclass Logger {
24ca0551cfSopenharmony_cipublic:
25ca0551cfSopenharmony_ci    static void D(const char* tag, const char* format, ...);
26ca0551cfSopenharmony_ci
27ca0551cfSopenharmony_ci    static void E(const char* tag, const char* format, ...);
28ca0551cfSopenharmony_ci
29ca0551cfSopenharmony_ci    static void V(const char* tag, const char* format, ...);
30ca0551cfSopenharmony_ci
31ca0551cfSopenharmony_ci    static void SetLevel(int level)
32ca0551cfSopenharmony_ci    {
33ca0551cfSopenharmony_ci        level_ = level;
34ca0551cfSopenharmony_ci    }
35ca0551cfSopenharmony_ci
36ca0551cfSopenharmony_ci    static constexpr int VERBOSE = 0;
37ca0551cfSopenharmony_ci    static constexpr int DEBUG = 1;
38ca0551cfSopenharmony_ci    static constexpr int ERROR = 2;
39ca0551cfSopenharmony_ci    static constexpr int NOLOG = 3;
40ca0551cfSopenharmony_ci
41ca0551cfSopenharmony_ciprivate:
42ca0551cfSopenharmony_ci    Logger();
43ca0551cfSopenharmony_ci
44ca0551cfSopenharmony_ci    ~Logger();
45ca0551cfSopenharmony_ci
46ca0551cfSopenharmony_ci    static void Log(const char* tag, const char* format, va_list args);
47ca0551cfSopenharmony_ci
48ca0551cfSopenharmony_ci    static void Err(const char* tag, const char* format, va_list args);
49ca0551cfSopenharmony_ci
50ca0551cfSopenharmony_ci    static int level_;
51ca0551cfSopenharmony_ci};
52ca0551cfSopenharmony_ci}
53ca0551cfSopenharmony_ci}
54ca0551cfSopenharmony_ci#endif // OHOS_IDL_LOGGER_H
55