SOLA
Loading...
Searching...
No Matches
minhton_logger_ns3.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_MINHTON_NS3_MINHTON_LOGGER_NS3_H_
18#define DAISI_MINHTON_NS3_MINHTON_LOGGER_NS3_H_
19
20#include <functional>
21#include <string>
22
23#include "logging/definitions.h"
24#include "minhton/core/node_info.h"
25#include "minhton/logging/logger_interface.h"
26#include "minhton/message/message.h"
27#include "solanet/uuid.h"
28
29namespace minhton {
30
32public:
33 MinhtonLoggerNs3(LogDeviceApp log_device_application, LogFunction log, LogEvent log_event);
34 ~MinhtonLoggerNs3() override;
35
36 void logCritical(const std::string &msg) const final;
37 void logWarning(const std::string &msg) const final;
38 void logInfo(const std::string &msg) const final;
39 void logDebug(const std::string &msg) const final;
40
41 void logNodeUninit(const LoggerInfoNodeState &info) final;
42 void logNodeRunning(const LoggerInfoNodeState &info) final;
43 void logNodeLeft(const LoggerInfoNodeState &info) final;
44 void logPhysicalNodeInfo(const LoggerPhysicalNodeInfo &info) final;
45 void logNode(const LoggerInfoAddNode &info) final;
46 void logNeighbor(const LoggerInfoAddNeighbor &info) final;
47 void logEvent(const LoggerInfoAddEvent &info) final;
48 void logSearchExactTest(const LoggerInfoSearchExact &info) final;
49 void logTraffic(const MessageLoggingInfo &info) final;
50 void logContent(const LoggerInfoAddContent &info) final;
51 void logFindQuery(const LoggerInfoAddFindQuery &info) final;
52 void logFindQueryResult(const LoggerInfoAddFindQueryResult &info) final;
53
54 // TODO Refactor to other class
55 void setApplicationUUID(const solanet::UUID &app_uuid) final {
56 LoggerInterface::uuid_ = solanet::uuidToString(app_uuid);
57 log_device_application_(uuid_);
58 }
59
60private:
61 // TODO Refactor to other class
62 LogDeviceApp log_device_application_;
63 LogFunction log_;
64 LogEvent log_event_;
65
66 void logMinhtonMessageTypes();
67 void logMinhtonNodeStates();
68 void logMinhtonRelationships();
69};
70
71} // namespace minhton
72
73#endif // MINHTON_NS3_LOGGER_H_
Definition logger_interface.h:86
Definition minhton_logger_ns3.h:31
void logEvent(const LoggerInfoAddEvent &info) final
Don't forget to use .c_str() to convert std::string into a char array.
Definition minhton_logger_ns3.cpp:35
Definition minhton_watchdog_ns3.cpp:24
Definition message_logging.h:23
Definition logger_interface.h:57
Definition logger_interface.h:46
Definition logger_interface.h:80
Definition logger_interface.h:71
Definition logger_interface.h:39
Definition logger_interface.h:31
Definition logger_interface.h:52
Definition logger_interface.h:19
Definition logger_interface.h:66