multiformats/js-multiaddr

DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

nijynot opened this issue · 1 comments

Getting this error when logging a Multiaddr

(node:20190) [DEP0079] DeprecationWarning: Custom inspection function on Objects
via .inspect() is deprecated

Related to this deprecation notice.

Looks like we'll need to convert to using symbols, https://nodejs.org/api/util.html#util_util_inspect_custom. We don't support older versions of Node, so we shouldn't need to worry about handling backwards compatibility.

Unless you need it, I'd recommend just casting the multiaddr to a string when logging.

const addr = multiaddr('/ip4/0.0.0.0/tcp/0')
console.log(String(addr))
console.log('multiaddr: %s', addr)