Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nijynot opened this issue Feb 13, 2020 · 1 comment · Fixed by #109
Closed
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P3 Low: Not priority right now

Comments

@nijynot
Copy link
Contributor

nijynot commented Feb 13, 2020

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.

@jacobheun
Copy link
Contributor

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)

@jacobheun jacobheun added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up P3 Low: Not priority right now status/ready Ready to be worked help wanted Seeking public contribution on this issue labels Feb 13, 2020
@jacobheun jacobheun removed the status/ready Ready to be worked label Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P3 Low: Not priority right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants