adding more tracing

dev
Nick Dumas 1 year ago
parent 9eadcedb0b
commit 7766253319

@ -35,6 +35,10 @@ func NewTELNETParser(c context.Context, s message.Subscriber, wml watermill.Logg
return &TELNETParser{
c: c,
s: s,
logger: wml,
logger: wml.With(
watermill.LogFields{
"name": "TELNETParser",
},
),
}
}

@ -24,14 +24,23 @@ func NewTELNETServer(c context.Context, l net.Listener, p message.Publisher, wml
c: c,
l: l,
p: p,
logger: wml,
logger: wml.With(
watermill.LogFields{
"name": "TELNETServer",
},
),
}
return &ts
}
func (ts *TELNETServer) Accept() (net.Conn, error) {
return ts.l.Accept()
conn, err := ts.l.Accept()
ts.logger.Trace("receiving telnet connection", watermill.LogFields{
"remoteAddr": conn.RemoteAddr(),
},
)
return conn, err
}
func (ts *TELNETServer) Handle(conn net.Conn) {
@ -43,7 +52,8 @@ func (ts *TELNETServer) Handle(conn net.Conn) {
correlationID := watermill.NewUUID()
ts.logger = ts.logger.With(
watermill.LogFields{
"correlation_id": correlationID},
"correlation_id": correlationID,
},
)
for s.Scan() {

Loading…
Cancel
Save