mdn / mdn/mdn

Add page for console.context(name)

Open
#692 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs triage proposal
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
Additional information

No response

Are you willing to support this work?

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.