From 0e5ae0a2f4879c9cacbc2f8ea87d26747c1ec49e Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Mon, 26 May 2025 14:12:35 +0200 Subject: [PATCH 1/2] [WIP] Specify console.context This specifies the console.context(label) method which returns a new console namespace object with an optional context name label. Tests: TBD Fixes #193 --- index.bs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/index.bs b/index.bs index 6a6ea21..b84c509 100644 --- a/index.bs +++ b/index.bs @@ -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 + console context(optional DOMString label = ""); }; @@ -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 timer table.

+

Contextualizing

+ +Each {{console}} namespace object has an associated context name, empty by default. + +

context(|label|)

+ +1. Let |context| be a new {{console}} namespace object. +1. Let |contextName| be the empty string. +1. If |label| is not null, let |contextName| be |label|. +1. Let |context|'s context name be |contextName|. +1. Return |context|. +

Supporting abstract operations

Logger(|logLevel|, |args|)

@@ -513,6 +528,9 @@ enhancements: src="images/severity-filter.png"> +
  • + Extra UI allowing the user to filter messages by context name +
  • Extra UI off to the side indicating the current state of the timer table, group stack, or other internally maintained data. From b45179685d77b8232fbd1fb24c7a4f32e9c7167b Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Mon, 26 May 2025 15:03:35 +0200 Subject: [PATCH 2/2] accept @annevk suggestions --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index b84c509..245e6ed 100644 --- a/index.bs +++ b/index.bs @@ -302,8 +302,8 @@ Each {{console}} namespace object has an associated context name, emp 1. Let |context| be a new {{console}} namespace object. 1. Let |contextName| be the empty string. -1. If |label| is not null, let |contextName| be |label|. -1. Let |context|'s context name be |contextName|. +1. If |label| is not null, then set |contextName| to |label|. +1. Set |context|'s context name to |contextName|. 1. Return |context|.

    Supporting abstract operations