Skip to content

Specify console.context #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ namespace console { // but see namespace object requirements below
undefined time(optional DOMString label = "default");
undefined timeLog(optional DOMString label = "default", any... data);
undefined timeEnd(optional DOMString label = "default");

// Contextualizing
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like this name, but couldn't find anything that would suit this. Maybe we don't need a "section" comment here? I was trying to replicate what was already there

console context(optional DOMString label = "");
};
</pre>

Expand Down Expand Up @@ -291,6 +294,18 @@ for plans to make {{console/timeEnd()}} and {{console/timeLog()}} formally repor
console when a given |label| does not exist in the associated <a>timer table</a>.
</p>

<h3 id="contextualizing">Contextualizing</h3>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not convinced about this name


Each {{console}} namespace object has an associated <dfn>context name</dfn>, empty by default.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should have an example here, or indicate that the context name could be consumed in the UI (for display/filtering)


<h4 id="context" method for="console">context(|label|)</h4>

1. Let |context| be a new {{console}} namespace object.
1. Let |contextName| be the empty string.
1. If |label| is not null, then set |contextName| to |label|.
1. Set |context|'s <a>context name</a> to |contextName|.
1. Return |context|.

<h2 id="supporting-ops">Supporting abstract operations</h2>

<h3 id="logger" abstract-op lt="Logger">Logger(|logLevel|, |args|)</h3>
Expand Down Expand Up @@ -513,6 +528,9 @@ enhancements:
src="images/severity-filter.png">
</div>
</li>
<li>
Extra UI allowing the user to filter messages by context name
</li>
<li>
Extra UI off to the side indicating the current state of the <a>timer table</a>,
<a>group stack</a>, or other internally maintained data.
Expand Down