SOLA
Loading...
Searching...
No Matches
minhton
include
minhton
logging
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 MINHTON_LOGGING_LOGGER_INTERFACE_H_
8
#define MINHTON_LOGGING_LOGGER_INTERFACE_H_
9
10
#include <string>
11
#include <vector>
12
13
#include "minhton/core/constants.h"
14
#include "minhton/message/message_logging.h"
15
#include "solanet/uuid.h"
16
17
namespace
minhton
{
18
19
struct
LoggerInfoSearchExact
{
20
uint64_t timestamp;
21
uint64_t event_id;
22
SearchExactTestEntryTypes status;
23
uint32_t sender_level;
24
uint32_t sender_number;
25
uint32_t target_level;
26
uint32_t target_number;
27
uint32_t hop_level;
28
uint32_t hop_number;
29
};
30
31
struct
LoggerInfoAddNode
{
32
std::string position_uuid;
33
uint32_t level;
34
uint32_t number;
35
uint16_t fanout;
36
bool
initialized;
37
};
38
39
struct
LoggerInfoAddNeighbor
{
40
uint64_t event_id;
41
std::string node_uuid;
42
std::string neighbor_node_uuid;
43
NeighborRelationship relationship;
44
};
45
46
struct
LoggerInfoAddEvent
{
47
uint64_t timestamp;
48
minhton::EventType event_type;
49
uint64_t event_id;
50
};
51
52
struct
LoggerInfoNodeState
{
53
std::string position_uuid;
54
uint64_t event_id;
55
};
56
57
struct
LoggerInfoAddContent
{
58
uint64_t timestamp;
59
std::string node_uuid;
60
ContentStatus content_status;
61
std::string attribute_name;
62
uint8_t content_type;
63
std::string content_text;
64
};
65
66
struct
LoggerPhysicalNodeInfo
{
67
std::string ip;
68
uint16_t port;
69
};
70
71
struct
LoggerInfoAddFindQuery
{
72
uint64_t timestamp;
73
uint64_t event_id;
74
std::string node_uuid;
75
bool
inquire_unknown;
76
bool
inquire_outdated;
77
std::string query;
78
};
79
80
struct
LoggerInfoAddFindQueryResult
{
81
uint64_t timestamp;
82
uint64_t event_id;
83
std::string node_uuid;
84
};
85
86
class
LoggerInterface
{
87
public
:
88
explicit
LoggerInterface
(std::string uuid) : uuid_(std::move(uuid)) {}
89
virtual
~LoggerInterface
() =
default
;
90
91
virtual
void
logCritical(
const
std::string &msg)
const
= 0;
92
virtual
void
logWarning(
const
std::string &msg)
const
= 0;
93
virtual
void
logInfo(
const
std::string &msg)
const
= 0;
94
virtual
void
logDebug(
const
std::string &msg)
const
= 0;
95
96
// Used for loggers which are initialized before node starts
97
virtual
void
setApplicationUUID(
const
solanet::UUID &app_uuid) = 0;
98
99
virtual
void
logNodeUninit(
const
LoggerInfoNodeState
&info) = 0;
100
virtual
void
logNodeRunning(
const
LoggerInfoNodeState
&info) = 0;
101
virtual
void
logNodeLeft(
const
LoggerInfoNodeState
&info) = 0;
102
virtual
void
logPhysicalNodeInfo(
const
LoggerPhysicalNodeInfo
&info) = 0;
103
virtual
void
logNode(
const
LoggerInfoAddNode
&info) = 0;
104
virtual
void
logNeighbor(
const
LoggerInfoAddNeighbor
&info) = 0;
105
virtual
void
logEvent(
const
LoggerInfoAddEvent
&info) = 0;
106
virtual
void
logSearchExactTest(
const
LoggerInfoSearchExact
&info) = 0;
107
virtual
void
logTraffic(
const
MessageLoggingInfo
&info) = 0;
108
virtual
void
logContent(
const
LoggerInfoAddContent
&info) = 0;
109
virtual
void
logFindQuery(
const
LoggerInfoAddFindQuery
&info) = 0;
110
virtual
void
logFindQueryResult(
const
LoggerInfoAddFindQueryResult
&info) = 0;
111
112
protected
:
113
std::string uuid_;
114
};
115
116
}
// namespace minhton
117
118
#endif
minhton::LoggerInterface
Definition
logger_interface.h:86
minhton
Definition
minhton_watchdog_ns3.cpp:24
MessageLoggingInfo
Definition
message_logging.h:23
minhton::LoggerInfoAddContent
Definition
logger_interface.h:57
minhton::LoggerInfoAddEvent
Definition
logger_interface.h:46
minhton::LoggerInfoAddFindQueryResult
Definition
logger_interface.h:80
minhton::LoggerInfoAddFindQuery
Definition
logger_interface.h:71
minhton::LoggerInfoAddNeighbor
Definition
logger_interface.h:39
minhton::LoggerInfoAddNode
Definition
logger_interface.h:31
minhton::LoggerInfoNodeState
Definition
logger_interface.h:52
minhton::LoggerInfoSearchExact
Definition
logger_interface.h:19
minhton::LoggerPhysicalNodeInfo
Definition
logger_interface.h:66
Generated by
1.9.8