Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
goshimmer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iota-imt
goshimmer
Commits
d7962911
Commit
d7962911
authored
5 years ago
by
capossele
Browse files
Options
Downloads
Patches
Plain Diff
improves debug logs
parent
ce132d2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/analysis/client/plugin.go
+5
-4
5 additions, 4 deletions
plugins/analysis/client/plugin.go
plugins/analysis/webinterface/recordedevents/recorded_events.go
+6
-0
6 additions, 0 deletions
...s/analysis/webinterface/recordedevents/recorded_events.go
with
11 additions
and
4 deletions
plugins/analysis/client/plugin.go
+
5
−
4
View file @
d7962911
package
client
import
(
"encoding/hex"
"net"
"time"
...
...
@@ -57,19 +58,19 @@ func Run(plugin *node.Plugin) {
func
getEventDispatchers
(
conn
*
network
.
ManagedConnection
)
*
EventDispatchers
{
return
&
EventDispatchers
{
AddNode
:
func
(
nodeId
[]
byte
)
{
log
.
Debugw
(
"AddNode"
,
"nodeId"
,
nodeId
)
log
.
Debugw
(
"AddNode"
,
"nodeId"
,
hex
.
EncodeToString
(
nodeId
)
)
_
,
_
=
conn
.
Write
((
&
addnode
.
Packet
{
NodeId
:
nodeId
})
.
Marshal
())
},
RemoveNode
:
func
(
nodeId
[]
byte
)
{
log
.
Debugw
(
"RemoveNode"
,
"nodeId"
,
nodeId
)
log
.
Debugw
(
"RemoveNode"
,
"nodeId"
,
hex
.
EncodeToString
(
nodeId
)
)
_
,
_
=
conn
.
Write
((
&
removenode
.
Packet
{
NodeId
:
nodeId
})
.
Marshal
())
},
ConnectNodes
:
func
(
sourceId
[]
byte
,
targetId
[]
byte
)
{
log
.
Debugw
(
"ConnectNodes"
,
"sourceId"
,
sourceId
,
"targetId"
,
targetId
)
log
.
Debugw
(
"ConnectNodes"
,
"sourceId"
,
hex
.
EncodeToString
(
sourceId
)
,
"targetId"
,
hex
.
EncodeToString
(
targetId
)
)
_
,
_
=
conn
.
Write
((
&
connectnodes
.
Packet
{
SourceId
:
sourceId
,
TargetId
:
targetId
})
.
Marshal
())
},
DisconnectNodes
:
func
(
sourceId
[]
byte
,
targetId
[]
byte
)
{
log
.
Debugw
(
"DisconnectNodes"
,
"sourceId"
,
sourceId
,
"targetId"
,
targetId
)
log
.
Debugw
(
"DisconnectNodes"
,
"sourceId"
,
hex
.
EncodeToString
(
sourceId
)
,
"targetId"
,
hex
.
EncodeToString
(
targetId
)
)
_
,
_
=
conn
.
Write
((
&
disconnectnodes
.
Packet
{
SourceId
:
sourceId
,
TargetId
:
targetId
})
.
Marshal
())
},
}
...
...
This diff is collapsed.
Click to expand it.
plugins/analysis/webinterface/recordedevents/recorded_events.go
+
6
−
0
View file @
d7962911
...
...
@@ -16,6 +16,7 @@ var lock sync.Mutex
func
Configure
(
plugin
*
node
.
Plugin
)
{
server
.
Events
.
AddNode
.
Attach
(
events
.
NewClosure
(
func
(
nodeId
string
)
{
plugin
.
Node
.
Logger
.
Debugw
(
"AddNode"
,
"nodeID"
,
nodeId
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
@@ -25,6 +26,7 @@ func Configure(plugin *node.Plugin) {
}))
server
.
Events
.
RemoveNode
.
Attach
(
events
.
NewClosure
(
func
(
nodeId
string
)
{
plugin
.
Node
.
Logger
.
Debugw
(
"RemoveNode"
,
"nodeID"
,
nodeId
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
@@ -32,6 +34,7 @@ func Configure(plugin *node.Plugin) {
}))
server
.
Events
.
NodeOnline
.
Attach
(
events
.
NewClosure
(
func
(
nodeId
string
)
{
plugin
.
Node
.
Logger
.
Debugw
(
"NodeOnline"
,
"nodeID"
,
nodeId
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
@@ -39,6 +42,7 @@ func Configure(plugin *node.Plugin) {
}))
server
.
Events
.
NodeOffline
.
Attach
(
events
.
NewClosure
(
func
(
nodeId
string
)
{
plugin
.
Node
.
Logger
.
Debugw
(
"NodeOffline"
,
"nodeID"
,
nodeId
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
@@ -46,6 +50,7 @@ func Configure(plugin *node.Plugin) {
}))
server
.
Events
.
ConnectNodes
.
Attach
(
events
.
NewClosure
(
func
(
sourceId
string
,
targetId
string
)
{
plugin
.
Node
.
Logger
.
Debugw
(
"ConnectNodes"
,
"sourceID"
,
sourceId
,
"targetId"
,
targetId
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
@@ -59,6 +64,7 @@ func Configure(plugin *node.Plugin) {
}))
server
.
Events
.
DisconnectNodes
.
Attach
(
events
.
NewClosure
(
func
(
sourceId
string
,
targetId
string
)
{
plugin
.
Node
.
Logger
.
Debugw
(
"DisconnectNodes"
,
"sourceID"
,
sourceId
,
"targetId"
,
targetId
)
lock
.
Lock
()
defer
lock
.
Unlock
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment