Skip to content

[Feature Request] Listing of registered keys, toggle #220

Description

@nyteshade

One thing that would be nice in our production environments is to be able to toggle on debug values during runtime without

  • Knowing which keys the developer used in the code
  • Restarting the server in question

It seems like this could be circumvented by exposing, via a method, the list of debug keys supplied in the form of require ('debug')(debugKey). Then, of course, a call to enable, if it does what it sounds like it does should start the logs flowing. The biggest issues being without looking through the code its hard to know what to even enable on the command line, the hard way.

It could also be enhanced to allow supplying a description such as

require('debug')(
  'ui:login',
  'Calls with this signature log the workings of the login process'
)
require('debug')(
  'ui:login:trace',
  'Calls with this signature log normally too verbose workings of the login process'
)

This way when doing something like require('debug').list() we might get a response such as:

[
  {key:'ui:login', desc:'Calls with this signature log the workings of the login process'},
  ...
]

If nobody else has provided a working, backwards compatible, solution to dynamic enabling and disabling of these log calls, I'll take a look myself.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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