Skip to content

console.log used directly #14

Description

@viglucci

The output from this library pollutes the output of consuming applications with unstructured log lines, as well as pollutes the console output for web/browser based applications.

Possible alternatives to using console.log directly would be to either use the (1) debug module, (2) allow the consumer to provide a logger that satisfies a contract when creating a client instance, (3) or to add conditionals around each log line to only log debug messaging if a certain ENV variable or other condition is met.

For what its worth, I believe (2) would likely be the best solution as this would allow for consumers to provide their own logger implementation and prefer structured logging if they choose.

https://github.com/netifi/netifi-js-client/blob/develop/src/Netifi.js#L188
https://github.com/netifi/netifi-js-client/blob/develop/src/Netifi.js#L292

image

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