Implementationsof the console API may differ between runtimes. In particular, some console methods may work differently or not work at all in some online editors and IDEs. To see the behavior described in this documentation, try the methods in your browser's developer tools, although even here, there are some differences between browsers.
The console object can be accessed from any global object. Window on browsing scopes and WorkerGlobalScope as specific variants in workers via the property console. It's exposed as Window.console, and can be referenced as console. For example:
Creates a new inline group, indenting all following output by another level. However, unlike console.group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it. To move back out a level, call console.groupEnd().
The console's most frequently used feature is logging text and other data. There are several categories of output you can generate using the console.log(),
console.info(), console.warn(), console.error(), or console.debug() methods. Each of these results in output styled differently in the log, and you can use the filtering controls provided by your browser to view only the kinds of output that interest you.
The browser will display as much information about the object as it can and wishes to. For example, private state of the object may be displayed too. Certain types of objects, such as DOM elements or functions, may also be displayed in a special way.
If you are going to mutate your object and you want to prevent the logged information from being updated, you can deep-clone the object before logging it. A common way is to JSON.stringify() and then JSON.parse() it:
Some browsers may implement additional format specifiers. For example, Safari and Firefox support the C-style precision formating %.f. For example console.log("Foo %.2f", 1.1) will output the number to 2 decimal places: Foo 1.10, while console.log("Foo %.2d", 1.1) will output the number as two significant figures with a leading 0: Foo 01.
Note: Each console message behaves like an inline element by default. If you want properties such as padding, margin, and so on to have any effect, you can set the display property to display: inline-block.
You can use nested groups to help organize your output by visually combining related material. To create a new nested block, call console.group(). The console.groupCollapsed() method is similar but creates the new block collapsed, requiring the use of a disclosure button to open it for reading.
You can start a timer to calculate the duration of a specific operation. To start one, call the console.time() method, giving it a name as the only parameter. To stop the timer, and to get the elapsed time in milliseconds, just call the console.timeEnd() method, again passing the timer's name as the parameter. Up to 10,000 timers can run simultaneously on a given page.
This specification is an early work in progress that welcomes feedback to refine toward moreprecise and compatible definitions. It is also the editors' first specification, so please be kindand constructive.
For historical web-compatibility reasons, the namespace object for console must have asits [[Prototype]] an empty object, created as if by ObjectCreate(%ObjectPrototype%), instead of %ObjectPrototype%.
A group is an implementation-specific, potentially-interactive viewfor output produced by calls to Printer, with one further level of indentationthan its parent. Each console namespace object has an associated group stack, whichis a stack, initially empty. Only the last group in a group stack will hostoutput produced by calls to Printer.
The logger operation accepts a log level and a list of other arguments. Its main output is theimplementation-defined side effect of printing the result to the console. This specificationdescribes how it processes format specifiers while doing so.
The formatter operation tries to format the first argument provided, using the other arguments. Itwill try to format the input until no formatting specifiers are left in the first argument, or nomore arguments are left. It returns a list of objects suitable for printing.
The printer operation is implementation-defined. It accepts a log level indicating severity, a Listof arguments to print, and an optional object of implementation-specific formatting options.Elements appearing in args will be one of the following:
If the console is not open when the printer operation is called, implementations should buffermessages to show them in the future up to an implementation-chosen limit (typically on the order ofat least 100).
Each console function uses a unique value for the logLevel parameter when callingPrinter, allowing implementations to customize each printed message depending on the function fromwhich it originated. However, it is common practice to group together certain functions and treattheir output similarly, in four broad categories. This table summarizes these common groupings:
Typically objects will be printed in a format that is suitable for their context. This sectiondescribes common ways in which objects are formatted to be most useful in their context. It shouldbe noted that the formatting described in this section is applied to implementation-specific objectrepresentations that will eventually be passed into Printer, where the actualside effect of formatting will be seen.
An object with generic JavaScript object formatting is a potentially expandablerepresentation of a generic JavaScript object. An object with optimally useful formatting is an implementation-specific, potentially-interactiverepresentation of an object judged to be maximally useful and informative.
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":
The editors would like to thankBoris Zbarsky,Brent S.A. Cowgill,Brian Grinstead,Corey Farwell,Ian Kilpatrick,Jeff Carpenter,Joseph Pecoraro,Justin Woo,Luc Martin,Noah Bass,Paul Irish,Raphal, andVictor Costanfor their contributions to this specification. You are awesome!
Copyright WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0International License. To the extent portions of it are incorporated into source code, suchportions in the source code are licensed under the BSD 3-Clause License instead.
The AWS Management Console is a web-based application that contains and provides centralized access to all individual AWS service consoles. You can use the AWS Management Console to search for services, view notifications, access AWS CloudShell, access account and billing information, and customize your general console settings. The home page of the AWS Management Console is called AWS Console Home. From AWS Console Home, you can manage your AWS applications and access all other individual service consoles. You can also customize AWS Console Home to show other helpful information about AWS and your resources by using widgets. You can add, remove, and rearrange widgets such as Recently visited, AWS Health, and more.
Each AWS service has its own individual service console. These service consoles are separate from the AWS Management Console. Settings you choose in Unified Settings, such as visual mode and default language, are applied to these consoles. Service consoles offer a wide range of tools for cloud computing, as well as information about your account and about your billing. If you want to know more about a specific service and its console, for example Amazon Elastic Compute Cloud, navigate to its console using search box in the navigation bar and access the Amazon EC2 documentation from the AWS Documentation website.
3a8082e126