Skip to content
Snippets Groups Projects
Commit 706fe9e5 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

improved logging

parent c4da9c36
No related branches found
No related tags found
2 merge requests!170Release,!125Garbled message logging
...@@ -8,12 +8,10 @@ ...@@ -8,12 +8,10 @@
package message package message
import ( import (
"encoding/base64"
"fmt" "fmt"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/stoppable" "gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/crypto/fingerprint"
"gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/ephemeral" "gitlab.com/xx_network/primitives/id/ephemeral"
...@@ -64,11 +62,7 @@ func (m *Manager) handleGarbledMessages() { ...@@ -64,11 +62,7 @@ func (m *Manager) handleGarbledMessages() {
//if it exists, check against all in the list //if it exists, check against all in the list
modifiedContents := append([]byte{0}, grbldMsg.GetContents()...) modifiedContents := append([]byte{0}, grbldMsg.GetContents()...)
identity := m.Session.GetUser().ReceptionID identity := m.Session.GetUser().ReceptionID
hasID, forMe, _ := m.Session.GetEdge().Check(identity, grbldMsg.GetIdentityFP(), modifiedContents) _, forMe, _ := m.Session.GetEdge().Check(identity, grbldMsg.GetIdentityFP(), modifiedContents)
jww.INFO.Printf("[GARBLE] Msg %d -- hasID: %t, forMe: %t, identity: %s, " +
"fp: %s, contentsHash: %s", i, hasID, forMe, identity,
base64.StdEncoding.EncodeToString(grbldMsg.GetIdentityFP()),
base64.StdEncoding.EncodeToString(fingerprint.GetMessageHash(modifiedContents)))
if forMe { if forMe {
fingerprint := grbldMsg.GetKeyFP() fingerprint := grbldMsg.GetKeyFP()
// Check if the key is there, process it if it is // Check if the key is there, process it if it is
......
...@@ -123,7 +123,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, ...@@ -123,7 +123,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message,
jww.WARN.Printf("Best round on send is nil") jww.WARN.Printf("Best round on send is nil")
continue continue
} }
jww.DEBUG.Printf("[sendCMIX] bestRound: %v", bestRound) jww.TRACE.Printf("[sendCMIX] bestRound: %v", bestRound)
// add the round on to the list of attempted, so it is not tried again // add the round on to the list of attempted, so it is not tried again
attempted.Insert(bestRound.GetRoundId()) attempted.Insert(bestRound.GetRoundId())
...@@ -149,7 +149,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, ...@@ -149,7 +149,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message,
continue continue
} }
jww.DEBUG.Printf("[sendCMIX] round %v processed, firstGW: %s", jww.TRACE.Printf("[sendCMIX] round %v processed, firstGW: %s",
bestRound, firstGateway) bestRound, firstGateway)
// Build the messages to send // Build the messages to send
...@@ -196,7 +196,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, ...@@ -196,7 +196,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message,
} }
return result, err return result, err
} }
jww.DEBUG.Printf("[sendCMIX] sendToPreferred %s", firstGateway) jww.TRACE.Printf("[sendCMIX] sendToPreferred %s", firstGateway)
result, err := sender.SendToPreferred( result, err := sender.SendToPreferred(
[]*id.ID{firstGateway}, sendFunc, stop, cmixParams.SendTimeout) []*id.ID{firstGateway}, sendFunc, stop, cmixParams.SendTimeout)
jww.DEBUG.Printf("[sendCMIX] sendToPreferred %s returned", jww.DEBUG.Printf("[sendCMIX] sendToPreferred %s returned",
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
package message package message
import ( import (
"encoding/base64"
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/interfaces/message"
...@@ -160,9 +159,6 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID, ...@@ -160,9 +159,6 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
msg.SetIdentityFP(ifp) msg.SetIdentityFP(ifp)
jww.INFO.Printf("Sending to %s with preimage %v, ifp: %v, messageHash: %s", recipient, preimage,
ifp, base64.StdEncoding.EncodeToString(append([]byte{0}, msg.GetContents()...)))
// Encrypt the message // Encrypt the message
salt := make([]byte, 32) salt := make([]byte, 32)
_, err = stream.Read(salt) _, err = stream.Read(salt)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment