ChainSafe / js-libp2p-yamux

Typescript implementation of Yamux
Other
10 stars 8 forks source link

Passing a logger is now required #69

Closed paralin closed 5 months ago

paralin commented 7 months ago

It was previously possible to construct yamux this way:

import { yamux } from '@chainsafe/libp2p-yamux'

const muxer = yamux()()

But now it's required to pass a Components with a logger.

It would be possible to make it backwards compatible:

https://github.com/paralin/js-libp2p-yamux/commit/b1feb9260c7bae59b1bc8c4f0bf47760e4ff7d58

Most of the code supports undefined "log" with this.log? (the question mark).

However, it seems libp2p's AbstractStream does not support undefined log: https://github.com/libp2p/js-libp2p/blob/bca8d6e689b47d85dda74082ed72e671139391de/packages/utils/src/abstract-stream.ts#L29 and https://github.com/libp2p/js-libp2p/issues/2275

paralin commented 5 months ago

I give up on this and will just pass a stub Log from now on.