diff --git a/skycoin-messenger/factory/conn.go b/skycoin-messenger/factory/conn.go index 85ad7c2..a578994 100644 --- a/skycoin-messenger/factory/conn.go +++ b/skycoin-messenger/factory/conn.go @@ -543,7 +543,11 @@ func (c *Connection) writeOP(op byte, object interface{}) error { if err != nil { return err } - c.GetContextLogger().Debugf("writeOP %#v", object) + + if c.factory.LogWriteOps { + c.GetContextLogger().Debugf("writeOP %#v", object) + } + return c.writeOPBytes(op, js) } @@ -552,7 +556,11 @@ func (c *Connection) writeOPSyn(op byte, object interface{}) error { if err != nil { return err } - c.GetContextLogger().Debugf("writeOP %#v", object) + + if c.factory.LogWriteOps { + c.GetContextLogger().Debugf("writeOP %#v", object) + } + data := make([]byte, MSG_HEADER_END+len(body)) data[MSG_OP_BEGIN] = op copy(data[MSG_HEADER_END:], body) diff --git a/skycoin-messenger/factory/factory.go b/skycoin-messenger/factory/factory.go index 0397ab2..db98f43 100644 --- a/skycoin-messenger/factory/factory.go +++ b/skycoin-messenger/factory/factory.go @@ -24,6 +24,10 @@ type MessengerFactory struct { // will deliver the services data to server if true Proxy bool + + // Log writeOP and writeOPSyn calls + LogWriteOps bool + serviceDiscovery defaultSeedConfig *SeedConfig