add logging context

This commit is contained in:
Dmitriy Ryajov 2019-09-11 15:06:10 -06:00
parent 875ec346e6
commit 32b74c5d1c
1 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,9 @@ import connection,
vbuffer, vbuffer,
protocols/protocol protocols/protocol
logScope:
topic = "Multistream"
const MsgSize* = 64*1024 const MsgSize* = 64*1024
const Codec* = "/multistream/1.0.0" const Codec* = "/multistream/1.0.0"
const MSCodec* = "\x13" & Codec & "\n" const MSCodec* = "\x13" & Codec & "\n"
@ -140,7 +143,7 @@ proc handle*(m: MultisteamSelect, conn: Connection) {.async, gcsafe.} =
await h.protocol.handler(conn, ms) await h.protocol.handler(conn, ms)
break main break main
except Exception as exc: except Exception as exc:
debug "handle: exception while handling ", msg = exc.msg # TODO: Logging debug "handle: exception while handling ", msg = exc.msg
debug "handle: no handlers for ", protocol = ms debug "handle: no handlers for ", protocol = ms
await conn.write(m.na) await conn.write(m.na)