-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Description
when running the basic getting started example the following error appears:
(node:290995) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
followed by a whole trace if you add the --trace-warnings flag.
This was fixed in Winston 2.4.5 but they do recommend moving to Winston 3.
That said, shipping with a logger is crossing concerns...
Libraries shouldn't have baked in loggers, but they can have interface to configure your own logger. for example you can pass a log function handler
import comedy from 'comedy';
comedy.setLogger((category, level, ...msg) => { /*handle however I want*/ });
// or
comedy.setLoggerFactory((category) => (level, ...msg) => { /* create a logger for each category*/ });
// then the rest of the usage stays exactly the same.