Skip to content

Commit 4d0faa0

Browse files
authored
Small devp2p Namespace Fixes (#3949)
* Small devp2p namespace addition fix * Small spelling fix * Fix per-message ETH protocol debugging
1 parent 8017184 commit 4d0faa0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/devp2p/src/protocol/protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export abstract class Protocol {
5454
}
5555

5656
private initMsgDebuggers(protocol: ProtocolType) {
57-
const MESSAGE_NAMES = Object.values(this._messageCodes).filter(
58-
(value) => typeof value === 'string',
57+
const MESSAGE_NAMES = Object.keys(this._messageCodes).filter(
58+
(key) => typeof key === 'string',
5959
) as string[]
6060
for (const name of MESSAGE_NAMES) {
6161
this.msgDebuggers[name] = devp2pDebug.extend(protocol).extend(name)

packages/devp2p/src/util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import { secp256k1 } from 'ethereum-cryptography/secp256k1.js'
1212

1313
import type { EthStatusMsg } from './protocol/eth.ts'
1414

15-
export const devp2pDebug = debug('devp2p:#')
15+
// Do not use :# here, no logging without sub namespace occurring and current code structure
16+
// otherwise creates loggers like `devp2p:#:eth`
17+
export const devp2pDebug = debug('devp2p')
1618

1719
export function genPrivateKey(): Uint8Array {
1820
const privateKey = secp256k1.utils.randomPrivateKey()

0 commit comments

Comments
 (0)