• 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 LOG_CONTROLLER_H
17 #define LOG_CONTROLLER_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include <hilog/log.h>
23 #include "hilogtool_msg.h"
24 #include "seq_packet_socket_client.h"
25 #include "hilogtool.h"
26 
27 namespace OHOS {
28 namespace HiviewDFX {
29 constexpr int RECV_BUF_LEN = MAX_LOG_LEN * 2;
30 
31 void SetMsgHead(MessageHeader* msgHeader, const uint8_t msgCmd, const uint16_t msgLen);
32 int MultiQuerySplit(const std::string& src, const char& delim, std::vector<std::string>& vec);
33 void NextRequestOp(SeqPacketSocketClient& controller, uint16_t sendId);
34 void LogQueryRequestOp(SeqPacketSocketClient& controller, const HilogArgs* context);
35 void LogQueryResponseOp(SeqPacketSocketClient& controller, char* recvBuffer, uint32_t bufLen,
36     const HilogArgs* context, uint32_t format);
37 int32_t BufferSizeOp(SeqPacketSocketClient& controller, uint8_t msgCmd,
38     const std::string& logTypeStr, const std::string& buffSizeStr);
39 int32_t StatisticInfoOp(SeqPacketSocketClient& controller, uint8_t msgCmd,
40     const std::string& logTypeStr, const std::string& domainStr);
41 int32_t LogClearOp(SeqPacketSocketClient& controller, uint8_t msgCmd, const std::string& logTypeStr);
42 int32_t LogPersistOp(SeqPacketSocketClient& controller, uint8_t msgCmd, LogPersistParam* logPersistParam);
43 int32_t SetPropertiesOp(SeqPacketSocketClient& controller, uint8_t operationType, SetPropertyParam* propertyParm);
44 } // namespace HiviewDFX
45 } // namespace OHOS
46 #endif
47