chore: make log topics consistent with nim-chronicles style

This commit is contained in:
Lorenzo Delgado 2022-11-03 16:36:24 +01:00 committed by GitHub
parent 1330f7745f
commit 5c4f1ce43f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 47 additions and 43 deletions

View File

@ -15,7 +15,7 @@ declarePublicGauge waku_discv5_discovered, "number of nodes discovered"
declarePublicGauge waku_discv5_errors, "number of waku discv5 errors", ["type"]
logScope:
topics = "wakudiscv5"
topics = "waku discv5"
type
WakuDiscoveryV5* = ref object

View File

@ -26,7 +26,7 @@ declarePublicGauge waku_dnsdisc_discovered, "number of nodes discovered"
declarePublicGauge waku_dnsdisc_errors, "number of waku dnsdisc errors", ["type"]
logScope:
topics = "wakudnsdisc"
topics = "waku dnsdisc"
type
WakuDnsDiscovery* = object

View File

@ -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

View File

@ -6,7 +6,7 @@ import
../waku_node
logScope:
topics = "debug api"
topics = "waku node jsonrpc debug_api"
proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -14,7 +14,8 @@ import
./api_types,
./topic_cache
logScope: topics = "rest_api_relay"
logScope:
topics = "waku node rest relay_api"
##### Topic cache

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -14,7 +14,7 @@ import
logScope:
topics = "message_store.storequeue"
topics = "waku node message_store storequeue"
const StoreQueueDefaultMaxCapacity* = 25_000

View File

@ -15,7 +15,7 @@ import
./queries
logScope:
topics = "message_store.sqlite"
topics = "waku node message_store sqlite"
proc init(db: SqliteDatabase): MessageStoreResult[void] =

View File

@ -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) =

View File

@ -46,7 +46,7 @@ declarePublicGauge waku_store_peers, "number of store peers"
declarePublicGauge waku_px_peers, "number of peers (in the node's peerManager) supporting the peer exchange protocol"
logScope:
topics = "wakunode"
topics = "waku node"
# Git version in git describe format (defined compile time)

View File

@ -19,7 +19,7 @@ import
logScope:
topics = "wakufilter.client"
topics = "waku filter client"
const Defaultstring = "/waku/2/default-waku/proto"

View File

@ -16,7 +16,7 @@ import
logScope:
topics = "wakufilter"
topics = "waku filter"
const

View File

@ -18,7 +18,7 @@ import
logScope:
topics = "wakulightpush.client"
topics = "waku lightpush client"
type WakuLightPushClient* = ref object

View File

@ -16,7 +16,7 @@ import
logScope:
topics = "wakulightpush"
topics = "waku lightpush"
const WakuLightPushCodec* = "/vac/waku/lightpush/2.0.0-beta1"

View File

@ -23,7 +23,7 @@ import libp2p/protocols/secure/secure
import ./noise_types
logScope:
topics = "wakunoise"
topics = "waku noise"
#################################################################

View File

@ -19,7 +19,7 @@ import ./noise
import ./noise_utils
logScope:
topics = "wakunoise"
topics = "waku noise"
#################################################################

View File

@ -18,7 +18,7 @@ import libp2p/errors
import libp2p/crypto/[crypto, chacha20poly1305, curve25519]
logScope:
topics = "wakunoise"
topics = "waku noise"
#################################################################

View File

@ -19,7 +19,7 @@ import ./noise_types
import ./noise
logScope:
topics = "wakunoise"
topics = "waku noise"
#################################################################

View File

@ -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

View File

@ -8,14 +8,15 @@ 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:
topics = "wakurelay"
topics = "waku relay"
const
WakuRelayCodec* = "/vac/waku/relay/2.0.0"

View File

@ -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

View File

@ -23,7 +23,7 @@ import
../waku_message
logScope:
topics = "wakurlnrelayutils"
topics = "waku rln_relay"
type MerkleNodeResult* = RlnRelayResult[MerkleNode]
type RateLimitProofResult* = RlnRelayResult[RateLimitProof]

View File

@ -22,7 +22,7 @@ import
logScope:
topics = "wakustore.client"
topics = "waku store client"
type WakuStoreClient* = ref object

View File

@ -29,7 +29,7 @@ import
logScope:
topics = "wakustore"
topics = "waku store"
const

View File

@ -55,7 +55,7 @@ declarePublicGauge waku_swap_messages, "number of swap messages received", ["typ
declarePublicHistogram waku_peer_swap_account_balance, "Swap Account Balance for waku peers, aggregated into buckets based on threshold limits", buckets = swapAccountBalanceBuckets
logScope:
topics = "wakuswap"
topics = "waku swap"
const WakuSwapCodec* = "/vac/waku/swap/2.0.0-beta1"

View File

@ -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]