margau / dmxnet

ArtNet-DMX-sender and receiver for nodejs
MIT License
69 stars 22 forks source link

Logging: Replace @hibas123/nodelogging with winston logger #31

Closed Patrick-Remy closed 3 years ago

Patrick-Remy commented 3 years ago

Currently this package is extremely verbose by default, and writes to /tmp files and console by default. This PR replaces the previously included, but rarely popular logging lib nodelogging by the widely-used lib winston. Also it adjusts log levels, to have fine-grained control over the output (now varies from debug, over silly and verbose to info).

The previous verbose property in the option is replaced by log to override and customize any logging behaviour. The simplest is to override log-level to e.g. error.

new dmxnet({
  log: { level: 'error' } 
})

or disable any outputs

new dmxnet({
  transports: []
})

This resolves #24, #23 and #18.

Also the PR #19 can be closed after merging this.

Patrick-Remy commented 3 years ago

Can you please merge the PR? As I think this is the only thing missing in this package, to be sort of usable as a dependency. I want to publish a homebridge package that relies on this package. But that isn't possible, as long as the previous logger is used, which is not configurable and creates unwanted files.

margau commented 3 years ago

Hi, thanks for the PR and sorry for the delay. Will test it soon and release/publish if okay. Thanks!