-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Labels
needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.Triage needed by staff and/or partners. Automatically applied when an issue is opened.proposalAuto label for new proposals added via the suggestion formAuto label for new proposals added via the suggestion form
Description
Proposal
console.context(label)
returns a new object with a lot of the console members. Messages emitted from calling the method from this created object can carry the context name, which can be used to categorize/filter them more easily.
Example:
const logger = console.context("myLogger");
logger.log("Hello");
logger.info("World");
With the example above, in Chrome you can use context:myLogger
in the filter input to only display messages emitted from the logger
object.
See the whatwg issue (whatwg/console#193) and the (WIP) PR to specifiy it (whatwg/console#244)
Browser support
At the moment console.context
is available in Chrome and Node (even though logs emitted from it are not visible, see nodejs/node#56634), and is currently being implemented in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1948870)
Tasks
- [ ]
Dependencies
- Maybe we need to wait for Specify console.context whatwg/console#244 to be merged? Not sure, because MDN seems to also document non standard methods (e.g. https://developer.mozilla.org/en-US/docs/Web/API/console/profile_static)
Additional information
No response
Are you willing to support this work?
No response
Metadata
Metadata
Assignees
Labels
needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.Triage needed by staff and/or partners. Automatically applied when an issue is opened.proposalAuto label for new proposals added via the suggestion formAuto label for new proposals added via the suggestion form