mirror of https://github.com/waku-org/nwaku.git
chore: make log topics consistent with nim-chronicles style
This commit is contained in:
parent
1330f7745f
commit
5c4f1ce43f
|
@ -17,7 +17,7 @@ import
|
|||
export jsonrpc_types
|
||||
|
||||
logScope:
|
||||
topics = "admin api"
|
||||
topics = "waku node jsonrpc admin_api"
|
||||
|
||||
const futTimeout* = 30.seconds # Max time to wait for futures
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import
|
|||
../waku_node
|
||||
|
||||
logScope:
|
||||
topics = "debug api"
|
||||
topics = "waku node jsonrpc debug_api"
|
||||
|
||||
proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import
|
|||
export jsonrpc_types
|
||||
|
||||
logScope:
|
||||
topics = "wakunode.rpc.filter"
|
||||
topics = "waku node jsonrpc filter_api"
|
||||
|
||||
|
||||
const DefaultPubsubTopic: PubsubTopic = "/waku/2/default-waku/proto"
|
||||
|
|
|
@ -14,7 +14,7 @@ import
|
|||
export waku_payload, jsonrpc_types
|
||||
|
||||
logScope:
|
||||
topics = "private api"
|
||||
topics = "waku node jsonrpc private_api"
|
||||
|
||||
const futTimeout* = 5.seconds # Max time to wait for futures
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import
|
|||
export jsonrpc_types
|
||||
|
||||
logScope:
|
||||
topics = "relay api"
|
||||
topics = "waku node jsonrpc relay_api"
|
||||
|
||||
const futTimeout* = 5.seconds # Max time to wait for futures
|
||||
const maxCache* = 30 # Max number of messages cached per topic @TODO make this configurable
|
||||
|
|
|
@ -15,7 +15,7 @@ import
|
|||
export jsonrpc_types
|
||||
|
||||
logScope:
|
||||
topics = "store api"
|
||||
topics = "waku node jsonrpc store_api"
|
||||
|
||||
proc installStoreApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
|
||||
const futTimeout = 5.seconds
|
||||
|
|
|
@ -9,7 +9,8 @@ import
|
|||
import
|
||||
../protocol/waku_message
|
||||
|
||||
logScope: topics = "message_cache"
|
||||
logScope:
|
||||
topics = "waku node message_cache"
|
||||
|
||||
const DefaultMessageCacheCapacity*: uint = 30 # Max number of messages cached per topic @TODO make this configurable
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ declarePublicCounter waku_node_conns_initiated, "Number of connections initiated
|
|||
declarePublicGauge waku_peers_errors, "Number of peer manager errors", ["type"]
|
||||
|
||||
logScope:
|
||||
topics = "wakupeers"
|
||||
topics = "waku node peer_manager"
|
||||
|
||||
type
|
||||
PeerManager* = ref object of RootObj
|
||||
|
@ -130,15 +130,13 @@ proc new*(T: type PeerManager, switch: Switch, storage: PeerStorage = nil): Peer
|
|||
peerStore: WakuPeerStore.new(),
|
||||
storage: storage)
|
||||
|
||||
debug "creating new PeerManager"
|
||||
|
||||
proc peerHook(peerId: PeerID, event: ConnEvent): Future[void] {.gcsafe.} =
|
||||
onConnEvent(pm, peerId, event)
|
||||
|
||||
pm.switch.addConnEventHandler(peerHook, ConnEventKind.Connected)
|
||||
pm.switch.addConnEventHandler(peerHook, ConnEventKind.Disconnected)
|
||||
|
||||
if not storage.isNil:
|
||||
if not storage.isNil():
|
||||
debug "found persistent peer storage"
|
||||
pm.loadFromStorage() # Load previously managed peers.
|
||||
else:
|
||||
|
|
|
@ -10,7 +10,8 @@ import "."/api_types
|
|||
import ".."/[serdes, utils]
|
||||
import ../../waku_node
|
||||
|
||||
logScope: topics = "rest_api_debug"
|
||||
logScope:
|
||||
topics = "waku node rest debug_api"
|
||||
|
||||
|
||||
#### Server request handlers
|
||||
|
|
|
@ -14,7 +14,8 @@ import
|
|||
./api_types,
|
||||
./topic_cache
|
||||
|
||||
logScope: topics = "rest_api_relay"
|
||||
logScope:
|
||||
topics = "waku node rest relay_api"
|
||||
|
||||
|
||||
##### Topic cache
|
||||
|
|
|
@ -9,7 +9,8 @@ import
|
|||
../../../protocol/waku_message,
|
||||
../../message_cache
|
||||
|
||||
logScope: topics = "rest_api_relay_topiccache"
|
||||
logScope:
|
||||
topics = "waku node rest relay_api"
|
||||
|
||||
export message_cache
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@ import
|
|||
json_serialization/std/[options, net, sets],
|
||||
presto/common
|
||||
|
||||
logScope: topics = "rest_api_serdes"
|
||||
logScope:
|
||||
topics = "waku node rest"
|
||||
|
||||
Json.createFlavor RestJson
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import
|
|||
./message_retention_policy
|
||||
|
||||
logScope:
|
||||
topics = "message_store.sqlite_store.retention_policy.capacity"
|
||||
topics = "waku node message_store retention_policy"
|
||||
|
||||
|
||||
const StoreDefaultCapacity*: int = 25_000
|
||||
|
|
|
@ -11,7 +11,7 @@ import
|
|||
./message_retention_policy
|
||||
|
||||
logScope:
|
||||
topics = "message_store.sqlite_store.retention_policy.time"
|
||||
topics = "waku node message_store retention_policy"
|
||||
|
||||
|
||||
const StoreDefaultRetentionTime*: int64 = 30.days.seconds
|
||||
|
|
|
@ -14,7 +14,7 @@ import
|
|||
|
||||
|
||||
logScope:
|
||||
topics = "message_store.storequeue"
|
||||
topics = "waku node message_store storequeue"
|
||||
|
||||
|
||||
const StoreQueueDefaultMaxCapacity* = 25_000
|
||||
|
|
|
@ -15,7 +15,7 @@ import
|
|||
./queries
|
||||
|
||||
logScope:
|
||||
topics = "message_store.sqlite"
|
||||
topics = "waku node message_store sqlite"
|
||||
|
||||
|
||||
proc init(db: SqliteDatabase): MessageStoreResult[void] =
|
||||
|
|
|
@ -22,7 +22,7 @@ when defined(rln) or defined(rlnzerokit):
|
|||
const LogInterval = 30.seconds
|
||||
|
||||
logScope:
|
||||
topics = "waku.metrics"
|
||||
topics = "waku node metrics"
|
||||
|
||||
|
||||
proc startMetricsServer*(serverIp: ValidIpAddress, serverPort: Port) =
|
||||
|
|
|
@ -19,7 +19,7 @@ import
|
|||
|
||||
|
||||
logScope:
|
||||
topics = "wakufilter.client"
|
||||
topics = "waku filter client"
|
||||
|
||||
|
||||
const Defaultstring = "/waku/2/default-waku/proto"
|
||||
|
|
|
@ -18,7 +18,7 @@ import
|
|||
|
||||
|
||||
logScope:
|
||||
topics = "wakulightpush.client"
|
||||
topics = "waku lightpush client"
|
||||
|
||||
|
||||
type WakuLightPushClient* = ref object
|
||||
|
|
|
@ -24,7 +24,7 @@ declarePublicGauge waku_px_peers_cached, "number of peer exchange peer ENRs cach
|
|||
declarePublicGauge waku_px_errors, "number of peer exchange errors", ["type"]
|
||||
|
||||
logScope:
|
||||
topics = "wakupx"
|
||||
topics = "waku peer_exchange"
|
||||
|
||||
|
||||
const
|
||||
|
|
|
@ -8,10 +8,11 @@ else:
|
|||
{.push raises: [].}
|
||||
|
||||
import
|
||||
std/[tables, sets],
|
||||
chronos, chronicles, metrics,
|
||||
libp2p/protocols/pubsub/[pubsub, gossipsub],
|
||||
libp2p/protocols/pubsub/rpc/messages,
|
||||
chronos,
|
||||
chronicles,
|
||||
metrics,
|
||||
libp2p/protocols/pubsub/pubsub,
|
||||
libp2p/protocols/pubsub/gossipsub,
|
||||
libp2p/stream/connection
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -11,7 +11,7 @@ import
|
|||
export metrics
|
||||
|
||||
logScope:
|
||||
topics = "waku-rln-relay.metrics"
|
||||
topics = "waku rln_relay"
|
||||
|
||||
func generateBucketsForHistogram*(length: int): seq[float64] =
|
||||
## Generate a custom set of 5 buckets for a given length
|
||||
|
|
|
@ -23,7 +23,7 @@ import
|
|||
../waku_message
|
||||
|
||||
logScope:
|
||||
topics = "wakurlnrelayutils"
|
||||
topics = "waku rln_relay"
|
||||
|
||||
type MerkleNodeResult* = RlnRelayResult[MerkleNode]
|
||||
type RateLimitProofResult* = RlnRelayResult[RateLimitProof]
|
||||
|
|
|
@ -22,7 +22,7 @@ import
|
|||
|
||||
|
||||
logScope:
|
||||
topics = "wakustore.client"
|
||||
topics = "waku store client"
|
||||
|
||||
|
||||
type WakuStoreClient* = ref object
|
||||
|
|
|
@ -10,7 +10,7 @@ import
|
|||
chronicles, stew/results
|
||||
|
||||
logScope:
|
||||
topics = "wakuswapcontracts"
|
||||
topics = "waku swap"
|
||||
|
||||
# TODO Richer error types than string, overkill for now...
|
||||
type NodeTaskJsonResult = Result[JsonNode, string]
|
||||
|
|
Loading…
Reference in New Issue