1686862fbSopenharmony_ci/*
2686862fbSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3686862fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4686862fbSopenharmony_ci * you may not use this file except in compliance with the License.
5686862fbSopenharmony_ci * You may obtain a copy of the License at
6686862fbSopenharmony_ci *
7686862fbSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8686862fbSopenharmony_ci *
9686862fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10686862fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11686862fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12686862fbSopenharmony_ci * See the License for the specific language governing permissions and
13686862fbSopenharmony_ci * limitations under the License.
14686862fbSopenharmony_ci */
15686862fbSopenharmony_ci
16686862fbSopenharmony_ci#ifndef CONTINUATION_MANAGER_LOG_H_
17686862fbSopenharmony_ci#define CONTINUATION_MANAGER_LOG_H_
18686862fbSopenharmony_ci
19686862fbSopenharmony_ci#include "errors.h"
20686862fbSopenharmony_ci#include "hilog/log.h"
21686862fbSopenharmony_ci#include "inttypes.h"
22686862fbSopenharmony_ci
23686862fbSopenharmony_cinamespace OHOS {
24686862fbSopenharmony_cinamespace DistributedSchedule {
25686862fbSopenharmony_ci#undef LOG_DOMAIN
26686862fbSopenharmony_ci#define LOG_DOMAIN 0xD004170
27686862fbSopenharmony_ci
28686862fbSopenharmony_ci#undef LOG_TAG
29686862fbSopenharmony_ci#define LOG_TAG "ContinuationMgrService"
30686862fbSopenharmony_ci
31686862fbSopenharmony_ci#ifdef HILOGD
32686862fbSopenharmony_ci#undef HILOGD
33686862fbSopenharmony_ci#endif
34686862fbSopenharmony_ci
35686862fbSopenharmony_ci#ifdef HILOGF
36686862fbSopenharmony_ci#undef HILOGF
37686862fbSopenharmony_ci#endif
38686862fbSopenharmony_ci
39686862fbSopenharmony_ci#ifdef HILOGE
40686862fbSopenharmony_ci#undef HILOGE
41686862fbSopenharmony_ci#endif
42686862fbSopenharmony_ci
43686862fbSopenharmony_ci#ifdef HILOGW
44686862fbSopenharmony_ci#undef HILOGW
45686862fbSopenharmony_ci#endif
46686862fbSopenharmony_ci
47686862fbSopenharmony_ci#ifdef HILOGI
48686862fbSopenharmony_ci#undef HILOGI
49686862fbSopenharmony_ci#endif
50686862fbSopenharmony_ci
51686862fbSopenharmony_ci#define HILOGF(fmt, ...) HILOG_FATAL(LOG_CORE, "%{public}s::%{public}s " fmt, TAG.c_str(), __FUNCTION__, ##__VA_ARGS__)
52686862fbSopenharmony_ci#define HILOGE(fmt, ...) HILOG_ERROR(LOG_CORE, "%{public}s::%{public}s " fmt, TAG.c_str(), __FUNCTION__, ##__VA_ARGS__)
53686862fbSopenharmony_ci#define HILOGW(fmt, ...) HILOG_WARN(LOG_CORE, "%{public}s::%{public}s " fmt, TAG.c_str(), __FUNCTION__, ##__VA_ARGS__)
54686862fbSopenharmony_ci#define HILOGI(fmt, ...) HILOG_INFO(LOG_CORE, "%{public}s::%{public}s " fmt, TAG.c_str(), __FUNCTION__, ##__VA_ARGS__)
55686862fbSopenharmony_ci#define HILOGD(fmt, ...) HILOG_DEBUG(LOG_CORE, "%{public}s::%{public}s " fmt, TAG.c_str(), __FUNCTION__, ##__VA_ARGS__)
56686862fbSopenharmony_ci
57686862fbSopenharmony_cienum {
58686862fbSopenharmony_ci    /**
59686862fbSopenharmony_ci     * Module type: Distributed schedule Service side
60686862fbSopenharmony_ci     */
61686862fbSopenharmony_ci    DMS_MODULE_TYPE_SERVICE = 0,
62686862fbSopenharmony_ci};
63686862fbSopenharmony_ci
64686862fbSopenharmony_ci// offset of dms error, only be used in this file.
65686862fbSopenharmony_ciconstexpr ErrCode DMS_SERVICE_ERR_OFFSET = ErrCodeOffset(SUBSYS_DISTRIBUTEDSCHEDULE, DMS_MODULE_TYPE_SERVICE);
66686862fbSopenharmony_ci
67686862fbSopenharmony_cienum {
68686862fbSopenharmony_ci    /**
69686862fbSopenharmony_ci     * Result(29360128) for invalid parameters.
70686862fbSopenharmony_ci     */
71686862fbSopenharmony_ci    INVALID_PARAMETERS_ERR = DMS_SERVICE_ERR_OFFSET,
72686862fbSopenharmony_ci    /**
73686862fbSopenharmony_ci     * Result(29360141) for dump write file error.
74686862fbSopenharmony_ci     */
75686862fbSopenharmony_ci    DMS_WRITE_FILE_FAILED_ERR = 29360141,
76686862fbSopenharmony_ci    /**
77686862fbSopenharmony_ci     * Result(29360157) for permission denied.
78686862fbSopenharmony_ci     */
79686862fbSopenharmony_ci    DMS_PERMISSION_DENIED = 29360157,
80686862fbSopenharmony_ci    /*
81686862fbSopenharmony_ci     * Result(29360207) for app registered exceed max times.
82686862fbSopenharmony_ci     */
83686862fbSopenharmony_ci    REGISTER_EXCEED_MAX_TIMES = 29360207,
84686862fbSopenharmony_ci    /*
85686862fbSopenharmony_ci     * Result(29360208) for token has not registered.
86686862fbSopenharmony_ci     */
87686862fbSopenharmony_ci    TOKEN_HAS_NOT_REGISTERED = 29360208,
88686862fbSopenharmony_ci    /*
89686862fbSopenharmony_ci     * Result(29360209) for callback has registered.
90686862fbSopenharmony_ci     */
91686862fbSopenharmony_ci    CALLBACK_HAS_REGISTERED = 29360209,
92686862fbSopenharmony_ci    /*
93686862fbSopenharmony_ci     * Result(29360210) for callback has not registered.
94686862fbSopenharmony_ci     */
95686862fbSopenharmony_ci    CALLBACK_HAS_NOT_REGISTERED = 29360210,
96686862fbSopenharmony_ci    /*
97686862fbSopenharmony_ci     * Result(29360211) for connect ability failed.
98686862fbSopenharmony_ci     */
99686862fbSopenharmony_ci    CONNECT_ABILITY_FAILED = 29360211,
100686862fbSopenharmony_ci    /*
101686862fbSopenharmony_ci     * Result(29360212) for disconnect ability failed.
102686862fbSopenharmony_ci     */
103686862fbSopenharmony_ci    DISCONNECT_ABILITY_FAILED = 29360212,
104686862fbSopenharmony_ci    /*
105686862fbSopenharmony_ci     * Result(29360214) for unknown callback type.
106686862fbSopenharmony_ci     */
107686862fbSopenharmony_ci    UNKNOWN_CALLBACK_TYPE = 29360214,
108686862fbSopenharmony_ci    /*
109686862fbSopenharmony_ci     * Result(29360215) for invalid connect status.
110686862fbSopenharmony_ci     */
111686862fbSopenharmony_ci    INVALID_CONNECT_STATUS = 29360215,
112686862fbSopenharmony_ci    /*
113686862fbSopenharmony_ci     * Result(29360216) for invalid continuation mode.
114686862fbSopenharmony_ci     */
115686862fbSopenharmony_ci    INVALID_CONTINUATION_MODE = 29360216,
116686862fbSopenharmony_ci};
117686862fbSopenharmony_ci} // namespace DistributedSchedule
118686862fbSopenharmony_ci} // namespace OHOS
119686862fbSopenharmony_ci#endif // CONTINUATION_MANAGER_LOG_H_
120