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 #ifndef EVENT_LOG_LOG_ACTION 16 #define EVENT_LOG_LOG_ACTION 17 18 #include <memory> 19 #include <string> 20 #include <vector> 21 22 #include "sys_event.h" 23 24 #include "event_log_task.h" 25 namespace OHOS { 26 namespace HiviewDFX { 27 class LogAction { 28 public: LogAction(int fd,std::shared_ptr<SysEvent> event)29 LogAction(int fd, std::shared_ptr<SysEvent> event) 30 : fd_(fd), 31 event_(event) {}; 32 ~LogAction()33 virtual ~LogAction(){}; 34 virtual void CaptureAction(); 35 void Init(); 36 protected: 37 int fd_; 38 std::shared_ptr<SysEvent> event_; 39 std::vector<std::string> cmdList_; 40 private: 41 std::unique_ptr<EventLogTask> logTask_; 42 }; 43 } // namespace HiviewDFX 44 } // namespace OHOS 45 #endif // EVENT_LOG_LOG_ACTION