Skip to content

Commit 6072c69

Browse files
fix: Log IMAP literals with append
We can now inspect the full message on append.
1 parent 64ae49d commit 6072c69

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

internal/session/command.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ package session
22

33
import (
44
"context"
5+
"fmt"
6+
"github.com/bradenaw/juniper/xslices"
7+
"golang.org/x/exp/maps"
58

69
"github.com/ProtonMail/gluon/internal/parser/proto"
710
"github.com/ProtonMail/gluon/internal/response"
@@ -62,7 +65,15 @@ func (s *Session) readCommand(del string) (string, *proto.Command, error) {
6265
return "", nil, err
6366
}
6467

65-
s.logIncoming(string(line))
68+
if len(literals) == 0 {
69+
s.logIncoming(string(line))
70+
} else {
71+
s.logIncoming(fmt.Sprintf("%v Literals: %v", string(line),
72+
xslices.Map(maps.Keys(literals), func(k string) string {
73+
return fmt.Sprintf("%v: '%v'", k, string(literals[k]))
74+
}),
75+
))
76+
}
6677

6778
tag, cmd, err := parse(line, literals, del)
6879
if err != nil {

0 commit comments

Comments
 (0)