Add page for console.context(name)
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1.4k
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
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 (https://github.com/whatwg/console/issues/193) and the (WIP) PR to specifiy it (https://github.com/whatwg/console/pull/244)
Browser support
At the moment console.context is available in Chrome and Node (even though logs emitted from it are not visible, see https://github.com/nodejs/node/issues/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 https://github.com/whatwg/console/pull/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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the WHATWG Console issue #193 and the WIP specification PR #244 to establish whether console.context(name) is ready to document. Check the existing MDN console documentation structure, then add the page once its behavior and browser support are sufficiently settled; done means the API is accurately documented with the example and compatibility information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100