pimterry / loglevel

:ledger: Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
MIT License
2.62k stars 157 forks source link

Extend the API with something like `loglevel.getLoggers()` #93

Closed myme closed 8 years ago

myme commented 8 years ago

Since loglevel supports sub-loggers through the loglevel.getLogger() function, would it be acceptable to have a function for listing existing loggers? I see that the object containing the logger references is within the module's closure and not accessible from the outside (which is good imho).

However, I'm wondering if it would be nice to have a function that reads the keys of this object and returns them as a list perhaps? Or some other structure which makes sense. I think this could be really useful when debugging an application which dynamically creates loggers, or if you have many loggers.

pimterry commented 8 years ago

As discussed in #94: this is implementable as a standalone plugin and (until there are common use cases where it would be particularly useful) that's where it should live for now.