node-apn / node-apn

:calling: Apple Push Notification module for Node.js
MIT License
4.37k stars 681 forks source link

Idea: Supporting loglevel/severity for filtering 'debug' output? #686

Open TysonAndre opened 3 years ago

TysonAndre commented 3 years ago

node-apn and its forks use https://www.npmjs.com/package/debug , which doesn't seem to provide a way to log by severity, just by topic (e.g. debug, info, warn, error, critical)

When sending a large number of pushes, it may be useful for an end user to only log failed pushes (e.g. info), connections/disconnects (e.g. warn), connection/protocol errors (e.g. error), and leave verbose logging to a debug level. Logging all successful push responses may be extremely verbose for normal use

There's many ways this could be done, e.g. require('node-apn').setMinLogLevel('info') or an environment variable.