SOLA
Loading...
Searching...
No Matches
logger_interface.h
1// Copyright The SOLA Contributors
2//
3// Licensed under the MIT License.
4// For details on the licensing terms, see the LICENSE file.
5// SPDX-License-Identifier: MIT
6
7#ifndef NATTER_LOGGER_INTERFACE_H_
8#define NATTER_LOGGER_INTERFACE_H_
9
10#include <memory>
11#include <string>
12#include <vector>
13
14#include "solanet/uuid.h"
15
16namespace natter::logging {
17
18class LoggerInterface;
19
20using LoggerPtr = std::shared_ptr<LoggerInterface>;
21
26public:
27 explicit LoggerInterface(std::string uuid) : uuid_(std::move(uuid)) {}
28 virtual ~LoggerInterface() = default;
29
34 virtual void logCritical(const std::string &msg) const = 0;
35
40 virtual void logWarning(const std::string &msg) const = 0;
41
46 virtual void logInfo(const std::string &msg) const = 0;
47
52 virtual void logDebug(const std::string &msg) const = 0;
53
61 virtual void logNewPeer(const std::string &ip, uint16_t port, solanet::UUID uuid,
62 const std::string &topic) const = 0;
63
71 virtual void logRemovePeer(const std::string &ip, uint16_t port, solanet::UUID uuid,
72 const std::string &topic) const = 0;
73
79 virtual void logNewMessage(const std::string &topic, const std::string &msg,
80 solanet::UUID msg_uuid) = 0;
81
88 virtual void logSendFullMsg(solanet::UUID msg_uuid, solanet::UUID uuid,
89 solanet::UUID own_uuid) = 0;
90
97 virtual void logReceiveFullMsg(solanet::UUID msg_uuid, solanet::UUID sender,
98 solanet::UUID own_uuid) = 0;
99
100 virtual void logMinhcastBroadcast(solanet::UUID msg_id, uint32_t level, uint32_t number,
101 uint32_t forward_up_limit, uint32_t forward_down_limit) = 0;
102
103 virtual void logNewNetworkPeer(solanet::UUID uuid, const std::string &ip, uint16_t port,
104 int level, int number) = 0;
105
106 virtual void logReceivedMessages(solanet::UUID node_uuid, solanet::UUID initial_sender,
107 solanet::UUID message, uint32_t round) = 0;
108
114 virtual void setApplicationUUID(const solanet::UUID &app_uuid) = 0;
115
116protected:
117 std::string uuid_;
118};
119} // namespace natter::logging
120
121#endif // NATTER_LOGGER_INTERFACE_H_
Definition logger_interface.h:25
virtual void logCritical(const std::string &msg) const =0
virtual void logReceiveFullMsg(solanet::UUID msg_uuid, solanet::UUID sender, solanet::UUID own_uuid)=0
virtual void setApplicationUUID(const solanet::UUID &app_uuid)=0
virtual void logWarning(const std::string &msg) const =0
virtual void logSendFullMsg(solanet::UUID msg_uuid, solanet::UUID uuid, solanet::UUID own_uuid)=0
virtual void logInfo(const std::string &msg) const =0
virtual void logNewMessage(const std::string &topic, const std::string &msg, solanet::UUID msg_uuid)=0
virtual void logRemovePeer(const std::string &ip, uint16_t port, solanet::UUID uuid, const std::string &topic) const =0
virtual void logNewPeer(const std::string &ip, uint16_t port, solanet::UUID uuid, const std::string &topic) const =0
virtual void logDebug(const std::string &msg) const =0