Create a component logger
import { defaultLogger } from '@libp2p/logger'import { peerIdFromString } from '@libp2p/peer-id'const logger = defaultLogger()const log = logger.forComponent('my-component')log.info('hello world')// logs "my-component hello world" Copy
import { defaultLogger } from '@libp2p/logger'import { peerIdFromString } from '@libp2p/peer-id'const logger = defaultLogger()const log = logger.forComponent('my-component')log.info('hello world')// logs "my-component hello world"
Create a component logger