1/*
2 * Copyright (C) 2022 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#include "netmanager_hitrace.h"
17
18#include "net_mgr_log_wrapper.h"
19
20namespace OHOS {
21namespace NetManagerStandard {
22void NetmanagerHiTrace::NetmanagerStartSyncTrace(const std::string &value)
23{
24    StartTrace(HITRACE_TAG_NET, value);
25    NETMGR_LOG_D("NetmanagerStartSyncTrace value:%{public}s", value.c_str());
26}
27
28void NetmanagerHiTrace::NetmanagerFinishSyncTrace(const std::string &value)
29{
30    FinishTrace(HITRACE_TAG_NET);
31    NETMGR_LOG_D("NetmanagerFinishSyncTrace value:%{public}s", value.c_str());
32}
33
34void NetmanagerHiTrace::NetmanagerStartAsyncTrace(const std::string &value, int32_t taskId)
35{
36    StartAsyncTrace(HITRACE_TAG_NET, value, taskId);
37    NETMGR_LOG_I("NetmanagerStartAsyncTrace value:%{public}s, taskId:%{public}d", value.c_str(), taskId);
38}
39
40void NetmanagerHiTrace::NetmanagerFinishAsyncTrace(const std::string &value, int32_t taskId)
41{
42    FinishAsyncTrace(HITRACE_TAG_NET, value, taskId);
43    NETMGR_LOG_I("NetmanagerFinishAsyncTrace value:%{public}s, taskId:%{public}d", value.c_str(), taskId);
44}
45} // namespace NetManagerStandard
46} // namespace OHOS
47