Create a component logger that will prefix any log messages with the passed string.
import { prefixLogger } from '@libp2p/logger'const logger = prefixLogger('my-node')const log = logger.forComponent('my-component')log.info('hello world')// logs "my-node:my-component hello world" Copy
import { prefixLogger } from '@libp2p/logger'const logger = prefixLogger('my-node')const log = logger.forComponent('my-component')log.info('hello world')// logs "my-node:my-component hello world"
Create a component logger that will prefix any log messages with the passed string.