@@ -12,7 +12,7 @@ type Conn struct {
12
12
// DebugCallback is a callback for every line of input and
13
13
// output. It is meant for debugging and is not guaranteed to
14
14
// be stable.
15
- DebugCallback func (line string )
15
+ DebugCallback func (operation , line string )
16
16
17
17
// Internal things
18
18
conn io.ReadWriteCloser
@@ -23,7 +23,7 @@ type Conn struct {
23
23
func NewConn (rwc io.ReadWriteCloser ) * Conn {
24
24
// Create the client
25
25
c := & Conn {
26
- func (line string ) {},
26
+ func (operation , line string ) {},
27
27
rwc ,
28
28
bufio .NewReader (rwc ),
29
29
}
@@ -34,7 +34,7 @@ func NewConn(rwc io.ReadWriteCloser) *Conn {
34
34
// Write is a simple function which will write the given line to the
35
35
// underlying connection.
36
36
func (c * Conn ) Write (line string ) {
37
- c .DebugCallback ("--> " + line )
37
+ c .DebugCallback ("write" , line )
38
38
c .conn .Write ([]byte (line ))
39
39
c .conn .Write ([]byte ("\r \n " ))
40
40
}
@@ -58,7 +58,7 @@ func (c *Conn) ReadMessage() (*Message, error) {
58
58
return nil , err
59
59
}
60
60
61
- c .DebugCallback ("<-- " + strings .TrimRight (line , "\r \n " ))
61
+ c .DebugCallback ("read" , strings .TrimRight (line , "\r \n " ))
62
62
63
63
// Parse the message from our line
64
64
m := ParseMessage (line )
0 commit comments