diff --git a/index.bs b/index.bs index 84574d2..b691184 100644 --- a/index.bs +++ b/index.bs @@ -157,22 +157,30 @@ The following is an informative summary of the format specifiers processed by th -

Printer(logLevel, args)

+

Printer(logLevel, args [, options])

-The printer operation is implementation-defined. It accepts a log level indicating severity, and a -List of arguments to print (which are either JavaScript objects, of any type, or are -implementation-specific representations of printable things such as a stack trace, a group, -or objects with either generic JavaScript object formatting or -optimally useful formatting applied). 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. +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-specific 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 in the elsewhere in the console -otherwise. +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 @@ -241,7 +249,7 @@ namespace console { // but see namespace object requirements below void table(any tabularData, optional sequence<DOMString> properties); void trace(any... data); void warn(any... data); - void dir(any item); + void dir(any item, optional object? options); void dirxml(any... data); // Grouping @@ -344,11 +352,11 @@ back to just logging the argument if it can't be parsed as tabular. Perform Logger("warn", data). -

dir(item)

+

dir(item, options)

1. Let _object_ be _item_ with generic JavaScript object formatting applied. - 1. Perform Printer("log", «_object_»). + 1. Perform Printer("log", «_object_», _options_).

dirxml(...data)