Skip to content

Commit bf6bae1

Browse files
authored
Merge pull request #153 from sincejune/un-quoted-payload
use un-quoted payload when logging into files
2 parents f4c4840 + c091039 commit bf6bae1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

publish/marshal.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"encoding/binary"
55
"fmt"
66
"net"
7-
"strconv"
87
strings "strings"
98
"unsafe"
109

@@ -339,7 +338,7 @@ func (h *HepMsg) String() string {
339338
if h == nil {
340339
return "nil"
341340
}
342-
s := strings.Join([]string{`&HEP{`,
341+
s := strings.Join([]string{`HEP packet:{`,
343342
`Version:` + fmt.Sprintf("%v", h.Version) + `,`,
344343
`Protocol:` + fmt.Sprintf("%v", h.Protocol) + `,`,
345344
`SrcIP:` + fmt.Sprintf("%v", h.SrcIP) + `,`,
@@ -351,12 +350,11 @@ func (h *HepMsg) String() string {
351350
`ProtoType:` + fmt.Sprintf("%v", h.ProtoType) + `,`,
352351
`NodeID:` + fmt.Sprintf("%v", h.NodeID) + `,`,
353352
`NodePW:` + fmt.Sprintf("%s", h.NodePW) + `,`,
354-
`Payload:` + fmt.Sprintf("%s", strconv.Quote(string(h.Payload))) + `,`,
355353
`CID:` + fmt.Sprintf("%s", h.CID) + `,`,
356-
`Vlan:` + fmt.Sprintf("%v", h.Vlan) + `,`,
354+
`Vlan:` + fmt.Sprintf("%v", h.Vlan),
357355
`}`,
358356
}, "")
359-
return s
357+
return s + " with Payload:\n" + fmt.Sprintf("%s", string(h.Payload))
360358
}
361359

362360
func unsafeBytesToStr(z []byte) string {

0 commit comments

Comments
 (0)