SOLA
Loading...
Searching...
No Matches
logger_manager.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_LOGGING_LOGGER_MANAGER_NS3_H_
18#define DAISI_LOGGING_LOGGER_MANAGER_NS3_H_
19
20#include <cstdint>
21#include <memory>
22#include <string>
23
24#include "cpps/common/cpps_logger_ns3.h"
25#include "definitions.h"
26#include "minhton-ns3/minhton_logger_ns3.h"
27#include "natter-ns3/natter_logger_ns3.h"
28// #include "path_planning/path_planning_logger_ns_3.h"
29#include "sola-ns3/sola_logger_ns3.h"
30#include "sqlite/sqlite_helper.h"
31
32namespace daisi {
33
34class LoggerManager;
35
36// Global logger manager that is initialized from Manager
37inline std::unique_ptr<LoggerManager> global_logger_manager;
38
40 std::string message;
41 std::string additional_parameters;
42};
43
45public:
46 LoggerManager(const std::string &path, const std::string &name);
48
49 void setFailed(const char *exception);
50 void logTestSetup(const LoggerInfoTestSetup &info);
51 void updateTestSetupTime();
52 void updateTestSetupEventCount(const uint64_t &count);
53
54 void logDevice(uint32_t id);
55 void logDeviceApplication(const std::string &application_uuid,
56 const std::string &application_name);
57 void logEvent(const std::string &event_uuid, uint16_t event_type,
58 const std::string &application_uuid);
59
60 void logMinhtonConfigFile(const std::string &file_path);
61
62 std::shared_ptr<minhton::MinhtonLoggerNs3> createMinhtonLogger(
63 const std::string &app_name_postfix = "");
64 std::shared_ptr<natter::logging::NatterLoggerNs3> createNatterLogger();
65 std::shared_ptr<daisi::cpps::CppsLoggerNs3> createAMRLogger();
66 std::shared_ptr<daisi::cpps::CppsLoggerNs3> createTOLogger();
67 // std::shared_ptr<daisi::path_planning::PathPlanningLoggerNs3> createPathPlanningLogger(
68 // const std::string &device_type = "");
69 std::shared_ptr<sola_ns3::SolaLoggerNs3> createSolaLogger();
70
71private:
72 daisi::SQLiteHelper sqlite_helper_;
73 const uint16_t minhton_event_type_base_ = 0;
74 const uint16_t natter_event_type_base_ = 256;
75 bool minhton_exists_ = false;
76 bool natter_exists_ = false;
77};
78} // namespace daisi
79
80#endif
Definition logger_manager.h:44
Definition sqlite_helper.h:28
Definition logger_manager.h:39