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
26namespace OHOS {
27namespace init_param {
28#define UNUSED(x) (void)(x)
29#ifndef WATCHER_DOMAIN
30#define WATCHER_DOMAIN (BASE_DOMAIN + 3)
31#endif
32#define WATCHER_LABEL "PARAM_WATCHER"
33#define WATCHER_LOGI(fmt, ...) STARTUP_LOGI(WATCHER_DOMAIN, WATCHER_LABEL, fmt, ##__VA_ARGS__)
34#define WATCHER_LOGE(fmt, ...) STARTUP_LOGE(WATCHER_DOMAIN, WATCHER_LABEL, fmt, ##__VA_ARGS__)
35#define WATCHER_LOGV(fmt, ...) STARTUP_LOGV(WATCHER_DOMAIN, WATCHER_LABEL, fmt, ##__VA_ARGS__)
36
37#define WATCHER_CHECK(retCode, exper, ...) \
38    if (!(retCode)) {                    \
39        WATCHER_LOGE(__VA_ARGS__);         \
40        exper;                           \
41    }
42} // namespace init_param
43} // namespace OHOS
44#endif // STARTUP_WATCHER_UTILS_H
45