Function defaultLogger

  • Create a component logger

    Returns ComponentLogger

    Example

    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"