blob: bed936cde4e0f26cdba70618a82ea67f2bd6e5ad [file] [log] [blame]
Adam Shih2a520eb2023-03-02 14:15:57 +08001/*
2 * Copyright 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Adam Shihad76e7c2023-03-06 17:04:00 +080016#include <android-base/properties.h>
kierancyphus52d632c2023-06-30 04:50:50 +080017#include <dump/pixel_dump.h>
Adam Shihad76e7c2023-03-06 17:04:00 +080018
kierancyphus047f0ac2023-11-10 15:02:57 +080019#include "android_property_manager_impl.h"
kierancyphus52d632c2023-06-30 04:50:50 +080020#include "dumper.h"
21#include "modem_log_dumper.h"
22
kierancyphus3ed60ce2023-11-10 14:40:18 +080023namespace pixel_modem::logging {
kierancyphus52d632c2023-06-30 04:50:50 +080024
25/**
kierancyphus52d632c2023-06-30 04:50:50 +080026 * @brief Implementation of Dumper that directly forwards to their corresponding
27 * dumpstate methods.
28 */
29class DumperImpl : public Dumper {
30 public:
31 void DumpLogs(const LogDumpInfo& log_dump_info) override {
32 dumpLogs(log_dump_info.src_dir.data(), log_dump_info.dest_dir.data(),
33 log_dump_info.limit, log_dump_info.prefix.data());
34 }
35 void CopyFile(const FileCopyInfo& file_copy_info) override {
36 copyFile(file_copy_info.src_dir.data(), file_copy_info.dest_dir.data());
37 }
38};
39
kierancyphus3ed60ce2023-11-10 14:40:18 +080040} // namespace pixel_modem::logging
Adam Shih2a520eb2023-03-02 14:15:57 +080041
42int main() {
kierancyphus3ed60ce2023-11-10 14:40:18 +080043 pixel_modem::logging::DumperImpl dumper_impl;
kierancyphus047f0ac2023-11-10 15:02:57 +080044 pixel_modem::AndroidPropertyManagerImpl android_property_manager_impl;
kierancyphus3ed60ce2023-11-10 14:40:18 +080045 pixel_modem::logging::ModemLogDumper modem_log_dumper(
kierancyphus52d632c2023-06-30 04:50:50 +080046 dumper_impl, android_property_manager_impl);
Adam Shihad76e7c2023-03-06 17:04:00 +080047
kierancyphus52d632c2023-06-30 04:50:50 +080048 modem_log_dumper.DumpModemLogs();
49 return 0;
Adam Shih2a520eb2023-03-02 14:15:57 +080050}