• 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 #ifndef STARTUP_WATCHER_UTILS_H
17 #define STARTUP_WATCHER_UTILS_H
18 #include <iostream>
19 
20 #include "init_log.h"
21 #include "iremote_broker.h"
22 #include "iremote_proxy.h"
23 
24 #include "securec.h"
25 
26 namespace OHOS {
27 namespace init_param {
28 #define UNUSED(x) (void)(x)
29 #define WATCHER_LOG_FILE "param_watcher.log"
30 #define WATCHER_LABEL "PARAM_WATCHER"
31 #define WATCHER_LOGI(fmt, ...) STARTUP_LOGI(WATCHER_LOG_FILE, WATCHER_LABEL, fmt, ##__VA_ARGS__)
32 #define WATCHER_LOGE(fmt, ...) STARTUP_LOGE(WATCHER_LOG_FILE, WATCHER_LABEL, fmt, ##__VA_ARGS__)
33 #define WATCHER_LOGV(fmt, ...) STARTUP_LOGV(WATCHER_LOG_FILE, WATCHER_LABEL, fmt, ##__VA_ARGS__)
34 
35 #define WATCHER_CHECK(retCode, exper, ...) \
36     if (!(retCode)) {                    \
37         WATCHER_LOGE(__VA_ARGS__);         \
38         exper;                           \
39     }
40 } // namespace init_param
41 } // namespace OHOS
42 #endif // STARTUP_WATCHER_UTILS_H
43