Skip to content

Silence console.log #183

Open
Open

Description

@jnovack

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?

Activity

  1. jmaxxz commented on Oct 13, 2015

    @jmaxxz
    Collaborator

    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.

  2. jnovack commented on Oct 13, 2015

    @jnovack
    Author

    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?

  3. ecaron commented on Jan 17, 2016

    @ecaron

    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.

  4. jnovack commented on Jan 17, 2016

    @jnovack
    Author

    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).

  5. ecaron commented on Jan 17, 2016

    @ecaron

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions