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

Silence console.log #183

Open
jnovack opened this issue Oct 3, 2015 · 5 comments
Open

Silence console.log #183

jnovack opened this issue Oct 3, 2015 · 5 comments

Comments

@jnovack
Copy link

jnovack commented Oct 3, 2015

There are times when I just want pcap to do what it's supposed to do and not complain when it sees something it cannot process.

$ sudo node index.js
node_pcap: EthernetFrame() - Don't know how to decode ethertype 4284
node_pcap: EthernetFrame() - Don't know how to decode ethertype 4284
mac address found
node_pcap: EthernetFrame() - Don't know how to decode ethertype 4284

Should the errors be emitted back so that the calling application can decide whether or not it wants to do something about it?

@jmaxxz
Copy link
Collaborator

jmaxxz commented Oct 13, 2015

As part of the work i was doing earlier this year I was attempting to remove all of these console logs. Unfortunately a bit of life has happened since then and I have not been as active as I would like to be. As winter roles around again for me I should get more inside time to work on this.

@jnovack
Copy link
Author

jnovack commented Oct 13, 2015

I wasn't complaining, I was opening a discussion. I appreciate your hard work in making my Amazon Dash button useful. :)

Do you feel that emitting them back as "error" (or whatever) is appropriate?

@ecaron
Copy link

ecaron commented Jan 17, 2016

I submitted #195 to address this (without requiring a major version change). It basically keeps the functionality as-is, but also provides mechanisms to attach it to another logger (like bunyan) or silence the output altogether.

@jnovack
Copy link
Author

jnovack commented Jan 17, 2016

This is a great first start, although, when including a package that includes node-pcap, it doesn't solve the problem (as the first package would then have to be modified by the calling application).

I would really like to a default silent (if approved by the maintainer).

@ecaron
Copy link

ecaron commented Jan 17, 2016

@jnovack, I'm in agreement (since my primary interest in this is from https://github.com/hortinstein/node-dash-button/). But I figured silencing it by default would warrant a breaking change from the existing application, and since I wasn't bold enough to suggest a major version that's why I went the passive route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants