From 74d2aea63d7396079848081dc7f693b0bb153246 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 9 Sep 2019 20:15:52 -0600 Subject: [PATCH] adding chronicles topics --- libp2p/muxers/mplex/channel.nim | 3 +++ libp2p/muxers/mplex/coder.nim | 5 ++++- libp2p/muxers/mplex/mplex.nim | 3 +++ libp2p/protocols/identify.nim | 3 +++ tests/testnative.nim | 3 ++- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libp2p/muxers/mplex/channel.nim b/libp2p/muxers/mplex/channel.nim index 38ce7b4..fd14c84 100644 --- a/libp2p/muxers/mplex/channel.nim +++ b/libp2p/muxers/mplex/channel.nim @@ -16,6 +16,9 @@ import types, ../../stream/lpstream, ../../connection +logScope: + topic = "mplex-channel" + const DefaultChannelSize* = DefaultBufferSize * 64 # 64kb type diff --git a/libp2p/muxers/mplex/coder.nim b/libp2p/muxers/mplex/coder.nim index 991285d..bd2827f 100644 --- a/libp2p/muxers/mplex/coder.nim +++ b/libp2p/muxers/mplex/coder.nim @@ -15,6 +15,9 @@ import types, ../../vbuffer, ../../stream/lpstream +logScope: + topic = "mplex-coder" + type Msg* = tuple id: uint @@ -72,4 +75,4 @@ proc writeMsg*(conn: Connection, id: uint, msgType: MessageType, data: string) {.async, gcsafe.} = - result = conn.writeMsg(id, msgType, cast[seq[byte]](toSeq(data.items))) \ No newline at end of file + result = conn.writeMsg(id, msgType, cast[seq[byte]](toSeq(data.items))) diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index c3428df..21fdf52 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -27,6 +27,9 @@ import coder, types, channel, ../../stream/bufferstream, ../../stream/lpstream +logScope: + topic = "mplex" + type Mplex* = ref object of Muxer remote*: Table[uint, Channel] diff --git a/libp2p/protocols/identify.nim b/libp2p/protocols/identify.nim index cce9006..f2df0d6 100644 --- a/libp2p/protocols/identify.nim +++ b/libp2p/protocols/identify.nim @@ -17,6 +17,9 @@ import ../protobuf/minprotobuf, ../multiaddress, ../protocols/protocol +logScope: + topic = "identify" + const IdentifyCodec* = "/ipfs/id/1.0.0" const IdentifyPushCodec* = "/ipfs/id/push/1.0.0" const ProtoVersion* = "ipfs/0.1.0" diff --git a/tests/testnative.nim b/tests/testnative.nim index bfc01c4..a9b4b5e 100644 --- a/tests/testnative.nim +++ b/tests/testnative.nim @@ -2,4 +2,5 @@ import unittest import testvarint, testbase32, testbase58, testbase64 import testrsa, testecnist, tested25519, testsecp256k1, testcrypto import testmultibase, testmultihash, testmultiaddress, testcid, testpeer -import testidentify, testtransport, testmultistream, testbufferstream, testmplex, testswitch +import testidentify, testtransport, testmultistream, testbufferstream, + testmplex, testswitch