Meta tags:
Headings (most frequently used words):
data, label, functions, console, loglevel, args, printer, abstract, table, of, index, references, options, terms, defined, by, contents, status, namespace, supporting, operations, acknowledgments, intellectual, property, rights, idl, logging, counting, grouping, timing, logger, formatter, reporting, warnings, to, the, this, specification, reference, normative, assert, condition, clear, debug, error, info, log, tabulardata, properties, trace, warn, 10, dir, item, 11, dirxml, count, countreset, group, groupcollapsed, groupend, time, timelog, timeend, summary, formatting, specifiers, indicating, severity, user, experience, innovation, common, object, formats, example, in, node, js,
Text of the page (most frequently used words):
the (137), data (78), android (60), for (60), #console (58), label (50), undefined (49), opera (40), chrome (40), safari (40), firefox (40), edge (40), group (40), let (40), current (32), any (32), object (28), and (27), printer (26), log (25), node (24), implementation (24), all (23), args (22), optional (21), formatting (21), mobile (20), samsung (20), internet (20), webview (20), ios (20), legacy (20), engines (20), mdn (20), with (20), table (19), defined (18), perform (18), this (17), map (16), not (16), count (15), string (15), stack (15), loglevel (15), converted (15), trace (14), timelog (14), empty (14), logger (14), otherwise (14), error (13), domstring (13), format (13), timeend (12), time (12), info (12), default (12), that (12), first (12), warn (11), namespace (11), options (11), timer (11), message (11), associated (11), dir (10), assert (10), item (10), from (10), output (10), will (10), functions (10), element (10), specifier (10), result (10), groupcollapsed (9), dirxml (9), debug (9), countreset (9), standard (9), generic (9), formatter (9), are (9), print (9), specifiers (9), return (9), tabulardata (8), specification (8), following (8), list (8), each (8), useful (8), javascript (8), which (8), indicating (8), concat (8), clear (7), properties (7), condition (7), terms (7), set (7), warning (7), should (7), implementations (7), operation (7), arguments (7), function (7), objects (7), common (7), calls (7), groupend (6), false (6), whatwg (6), call (6), optimally (6), space (6), duck (6), applied (6), user (6), new (6), has (6), optionally (6), grouplabel (6), but (5), see (5), logging (5), grouping (5), living (5), into (5), stdout (5), example (5), interactive (5), last (5), duration (5), timertable (5), counting (4), timing (4), index (4), infra (4), ecmascript (4), references (4), defines (4), work (4), such (4), their (4), description (4), prints (4), util (4), potentially (4), representation (4), side (4), messages (4), level (4), severity (4), have (4), been (4), its (4), produced (4), more (4), when (4), appropriate (4), developer (4), elements (4), target (4), concatenation (4), 003a (4), 0020 (4), representing (4), starttime (4), some (4), mytimer (4), initially (4), none (3), sequence (3), boolean (3), idl (3), url (3), https (3), webidl (3), web (3), domenic (3), normative (3), push (3), prepend (3), exist (3), append (3), symbol (3), parseint (3), parsefloat (3), objectprototype (3), report (3), portions (3), code (3), instead (3), given (3), these (3), reporting (3), warnings (3), write (3), here (3), non (3), process (3), informative (3), printed (3), something (3), important (3), extra (3), other (3), only (3), also (3), together (3), one (3), make (3), value (3), called (3), substitutes (3), summary (3), algorithm (3), possible (3), left (3), argument (3), printing (3), abstract (3), does (3), 4650 (3), environment (3), incorporate (3), finallist (3), exposed (2), requirements (2), below (2), spec (2), org (2), denicola (2), size (2), remove (2), pop (2), tostring (2), objectcreate (2), reference (2), review (2), version (2), view (2), google (2), licensed (2), under (2), source (2), license (2), intellectual (2), property (2), rights (2), com (2), kowalski (2), terin (2), editors (2), would (2), you (2), acknowledgments (2), must (2), steps (2), platform (2), join (2), previously (2), formatted (2), foo (2), bar (2), becomes (2), stderr (2), const (2), using (2), typically (2), suitable (2), context (2), section (2), describes (2), ways (2), representations (2), passed (2), where (2), effect (2), seen (2), formats (2), off (2), allowing (2), identical (2), experience (2), innovation (2), always (2), can (2), while (2), groupings (2), meant (2), parameter (2), open (2), them (2), how (2), use (2), specific (2), type (2), accepts (2), provided (2), displayed (2), starting (2), todo (2), nan (2), was (2), try (2), consoles (2), hello (2), then (2), rest (2), supporting (2), operations (2), difference (2), between (2), perhaps (2), app (2), entry (2), key (2), strings (2), onto (2), supports (2), groups (2), chosen (2), without (2), generically (2), exists (2), identifier (2), formatteddata (2), assertion (2), historical (2), reasons (2), please (2), issue (2), tests (2), github (2), commits (2), edgar, chen, timothy, anne, van, kesteren, tc39, ecma262, multipage, language, contain, those, interested, patent, draft, copyright, apple, mozilla, microsoft, extent, incorporated, bsd, clause, creative, commons, attribution, international, written, major, help, domfarolino, gmail, dominic, farolino, rok, robert, terinstock, stock, like, thank, boris, zbarsky, brent, cowgill, brian, grinstead, corey, farwell, ian, kilpatrick, jeff, carpenter, joseph, pecoraro, justin, woo, luc, martin, noah, bass, paul, irish, raphaël, victor, costan, contributions, awesome, reportwarning, derived, run, simplest, way, implement, separated, lot, done, stringifies, nested, converts, readable, require, else, expandable, judged, maximally, most, noted, described, eventually, actual, flashing, alert, state, internally, maintained, filter, batches, multiple, provides, number, batched, duplication, prevent, spam, since, innovations, exhaustive, potential, enhancements, might, could, update, counts, chose, blue, leaving, neutral, color, document, practices, constrain, providing, special, behavior, examples, indicated, uses, unique, calling, customize, depending, originated, however, practice, certain, treat, similarly, four, broad, categories, summarizes, buffer, show, future, limit, order, least, 100, taken, account, consumed, present, job, simply, appear, within, elsewhere, separate, similar, become, expectation, null, may, apply, either, printable, things, appearing, applies, css, float, integer, conversion, purpose, processed, above, containing, third, onward, previous, replace, found, find, right, second, tries, input, until, returns, occurs, before, returning, many, entered, enters, main, processes, doing, plans, formally, 134, included, easier, users, supply, intermediate, logs, throughout, life, fetch, filling, setup, making, api, now, runs, bootstrap, complex, application, seconds, reasonable, displaying, already, started, contains, times, collapsed, expanded, further, indentation, than, parent, host, numbers, dom, tree, guaranteed, same, callstack, need, good, construct, columns, rows, fall, back, just, parsed, tabular, nothing, failure, failed, true, compatibility, prototype, created, visible, usable, scripts, even, opened, lowercased, discussion, tracker, early, progress, welcomes, feedback, refine, toward, precise, compatible, definitions, kind, constructive, status, contents, apis, debugging, facilities, 한국어, 简体中文, 日本語, translations, ongoing, consolelog, snapshot, commit, chat, matrix, issues, participate, updated, march, 2026,
Text of the page (random words):
data perform logger info data 1 1 6 log data perform logger log data 1 1 7 table tabulardata properties try to construct a table with the columns of the properties of tabulardata or use properties and rows of tabulardata and log it with a loglevel of log fall back to just logging the argument if it can t be parsed as tabular todo this will need a good algorithm 1 1 8 trace data let trace be some implementation defined potentially interactive representation of the callstack from where this function was called optionally let formatteddata be the result of formatter data and incorporate formatteddata as a label for trace perform printer trace trace the identifier of a function printed in a stack trace is implementation defined it is also not guaranteed to be the same identifier that would be seen in new error stack 1 1 9 warn data perform logger warn data 1 1 10 dir item options let object be item with generic javascript object formatting applied perform printer dir object options 1 1 11 dirxml data let finallist be a new list initially empty for each item of data let converted be a dom tree representation of item if possible otherwise let converted be item with optimally useful formatting applied append converted to finallist perform logger dirxml finallist 1 2 counting functions each console namespace object has an associated count map which is a map of strings to numbers initially empty 1 2 1 count label let map be the associated count map if map label exists set map label to map label 1 otherwise set map label to 1 let concat be the concatenation of label u 003a u 0020 space and tostring map label perform logger count concat 1 2 2 countreset label let map be the associated count map if map label exists set map label to 0 otherwise let message be a string without any formatting specifiers indicating generically that the given label does not have an associated count perform logger countreset message 1 3 grouping functions a group is an implementation defined potentially interactive view for output produced by calls to printer with one further level of indentation than its parent each console namespace object has an associated group stack which is a stack initially empty only the last group in a group stack will host output produced by calls to printer 1 3 1 group data let group be a new group if data is not empty let grouplabel be the result of formatter data otherwise let grouplabel be an implementation chosen label representing a group incorporate grouplabel as a label for group optionally if the environment supports interactive groups group should be expanded by default perform printer group group push group onto the appropriate group stack 1 3 2 groupcollapsed data let group be a new group if data is not empty let grouplabel be the result of formatter data otherwise let grouplabel be an implementation chosen label representing a group incorporate grouplabel as a label for group optionally if the environment supports interactive groups group should be collapsed by default perform printer groupcollapsed group push group onto the appropriate group stack 1 3 3 groupend pop the last group from the group stack 1 4 timing functions each console namespace object has an associated timer table which is a map of strings to times initially empty 1 4 1 time label if the associated timer table contains an entry with key label return optionally reporting a warning to the console indicating that a timer with label label has already been started otherwise set the value of the entry with key label in the associated timer table to the current time 1 4 2 timelog label data let timertable be the associated timer table let starttime be timertable label let duration be a string representing the difference between the current time and starttime in an implementation defined format 4650 4650 69 ms 5 seconds and 00 05 are all reasonable ways of displaying a 4650 69 ms duration let concat be the concatenation of label u 003a u 0020 space and duration prepend concat to data perform printer timelog data the data parameter in calls to timelog is included in the call to logger to make it easier for users to supply intermediate timer logs with some extra data throughout the life of a timer for example console time mytimer console timelog mytimer starting application up perhaps some code runs to bootstrap a complex app console timelog mytimer ui is setup making api calls now perhaps some fetch s here filling the app with data console timeend mytimer 1 4 3 timeend label let timertable be the associated timer table let starttime be timertable label remove timertable label let duration be a string representing the difference between the current time and starttime in an implementation defined format let concat be the concatenation of label u 003a u 0020 space and duration perform printer timeend concat see whatwg console 134 for plans to make timeend and timelog formally report warnings to the console when a given label does not exist in the associated timer table 2 supporting abstract operations 2 1 logger loglevel args the logger operation accepts a log level and a list of other arguments its main output is the implementation defined side effect of printing the result to the console this specification describes how it processes format specifiers while doing so if args is empty return let first be args 0 let rest be all elements following first in args if rest is empty perform printer loglevel first and return otherwise perform printer loglevel formatter args return undefined it s important that the printing occurs before returning from the algorithm many developer consoles print the result of the last operation entered into them in such consoles when a developer enters console log hello this will first print hello then the undefined return value from the console log call 2 2 formatter args the formatter operation tries to format the first argument provided using the other arguments it will try to format the input until no formatting specifiers are left in the first argument or no more arguments are left it returns a list of objects suitable for printing if args s size is 1 return args let target be the first element of args let current be the second element of args find the first possible format specifier specifier from the left to the right in target if no format specifier was found return args otherwise if specifier is s let converted be the result of call string undefined current if specifier is d or i if current is a symbol let converted be nan otherwise let converted be the result of call parseint undefined current 10 if specifier is f if current is a symbol let converted be nan otherwise let converted be the result of call parsefloat undefined current if specifier is o optionally let converted be current with optimally useful formatting applied if specifier is o optionally let converted be current with generic javascript object formatting applied todo process c if any of the previous steps set converted replace specifier in target with converted let result be a list containing target together with the elements of args starting from the third onward return formatter result 2 2 1 summary of formatting specifiers the following is an informative summary of the format specifiers processed by the above algorithm specifier purpose type conversion s element which substitutes is converted to a string string element d or i element which substitutes is converted to an integer parseint element 10 f element which substitutes is converted to a float parsefloat element 10 o element is displayed with optimally useful formatting n a o element is displayed with generic javascript object formatting n a c applies provided css n a 2 3 printer loglevel args options the printer operation is implementation defined it accepts a log level indicating severity a list of arguments to print and an optional object of implementation specific formatting options elements appearing in args will be one of the following javascript objects of any type implementation specific representations of printable things such as a stack trace or group objects with either generic javascript object formatting or optimally useful formatting applied if the options object is passed and is not undefined or null implementations may use options to apply implementation defined formatting to the elements in args how the implementation prints args is up to the implementation but implementations should separate the objects by a space or something similar as that has become a developer expectation by the time the printer operation is called all format specifiers will have been taken into account and any arguments that are meant to be consumed by format specifiers will not be present in args the implementation s job is simply to print the list the output produced by calls to printer should appear only within the last group on the appropriate group stack if the group stack is not empty or elsewhere in the console otherwise if the console is not open when the printer operation is called implementations should buffer messages to show them in the future up to an implementation defined limit typically on the order of at least 100 2 3 1 indicating loglevel severity each console function uses a unique value for the loglevel parameter when calling printer allowing implementations to customize each printed message depending on the function from which it originated however it is common practice to group together certain functions and treat their output similarly in four broad categories this table summarizes these common groupings grouping console functions description log log trace dir dirxml group groupcollapsed debug timelog a generic log info count info timeend an informative log warn warn countreset a log warning the user of something indicated by the message error error assert a log indicating an error to the user these groupings are meant to document common practices and do not constrain implementations from providing special behavior for each function as in the following examples here you can see one implementation chose to make output produced by calls to timeend blue while leaving info a more neutral color calls to count might not always print new output but instead could update previously output counts 2 3 2 printer user experience innovation since printer is implementation defined it is common to see ux innovations in its implementations the following is a non exhaustive list of potential ux enhancements de duplication of identical output to prevent spam in this example the implementation not only batches multiple identical messages but also provides the number of messages that have been batched together extra ui off to the side allowing the user to filter messages by log level severity extra ui off to the side indicating the current state of the timer table group stack or other internally maintained data flashing portions of the console to alert the user of something important 2 3 3 common object formats typically objects will be printed in a format that is suitable for their context this section describes common ways in which objects are formatted to be most useful in their context it should be noted that the formatting described in this section is applied to implementation defined object representations that will eventually be passed into printer where the actual side effect of formatting will be seen an object with generic javascript object formatting is a potentially expandable representation of a generic javascript object an object with optimally useful formatting is an implementation defined potentially interactive representation of an object judged to be maximally useful and informative 2 3 4 example printer in node js the simplest way to implement the printer operation on the node js platform is to join the previously formatted arguments separated by a space and write the output to stdout or stderr example implementation in node js using ecmascript const util require util function print loglevel args const message util format args if loglevel error process stderr write message n else if loglevel log loglevel info loglevel warn process stdout write message n here a lot of the work is done by the util format function it stringifies nested objects and converts non string arguments into a readable string version e g undefined becomes the string undefined and false becomes false print log duck foo bar prints duck foo bar n on stdout print log duck false prints duck false n on stdout print log duck undefined prints duck undefined n on stdout 2 4 reporting warnings to the console to report a warning to the console given a generic description of a warning description implementations must run these steps let warning be an implementation defined string derived from description perform printer reportwarning warning acknowledgments the editors would like to thank boris zbarsky brent s a cowgill brian grinstead corey farwell ian kilpatrick jeff carpenter joseph pecoraro justin woo luc martin noah bass paul irish raphaël and victor costan for their contributions to this specification you are awesome this standard is written by terin stock terin terinstock com robert kowalski rok kowalski gd and dominic farolino domfarolino gmail com with major help from domenic denicola google d domenic me intellectual property rights copyright whatwg apple google mozilla microsoft this work is licensed under a creative commons attribution 4 0 international license to the extent portions of it are incorporated into source code such portions in the source code are licensed under the bsd 3 clause license instead this is the living standard those interested in the patent review version should view the living standard review draft index terms defined by this specification assert in 1 1 assert condition in 1 1 assert condition data in 1 1 clear in 1 1 1 console in 1 count in 1 2 count label in 1 2 count map in 1 2 countreset in 1 2 1 countreset label in 1 2 1 debug in 1 1 2 debug data in 1 1 2 dir in 1 1 9 dir item in 1 1 9 dir item options in 1 1 9 dirxml in 1 1 10 dirxml data in 1 1 10 error in 1 1 3 error data in 1 1 3 formatter in 2 1 generic javascript object formatting in 2 3 3 group in 1 3 group in 1 3 groupcollapsed in 1 3 1 groupcollapsed data in 1 3 1 group data in 1 3 groupend in 1 3 2 group stack in 1 3 info in 1 1 4 info data in 1 1 4 log in 1 1 5 log data in 1 1 5 logger in 2 optimally useful formatting in 2 3 3 printer in 2 2 1 report a warning to the console in 2 4 table in 1 1 6 table tabulardata in 1 1 6 table tabulardata properties in 1 1 6 time in 1 4 timeend in 1 4 2 timeend label in 1 4 2 time label in 1 4 timelog in 1 4 1 timelog label in 1 4 1 timelog label data in 1 4 1 timer table in 1 4 trace in 1 1 7 trace data in 1 1 7 warn in 1 1 8 warn data in 1 1 8 terms defined by reference ecmascript defines the following terms objectprototype string parsefloat parseint call objectcreate tostring is a symb...
|