aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/console/log/index.html
blob: b41ed58e2d5a4aed4f729d512965a984e00094df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
title: Console.log()
slug: Web/API/Console/log
translation_of: Web/API/Console/log
---
<div>{{APIRef("Console API")}}{{Non-standard_header}}</div>

<h2 id="Summary" name="Summary">Sumário</h2>

<p>Exibe uma mensagem na console do navegador.</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>

<pre class="syntaxbox">console.log(<em>obj1</em>[, <em>obj2</em>, ..., <em>objN]</em>);
console.log(<em>msg</em>[, <em>subst1</em>, ..., <em>substN]</em>);
</pre>

<h2 id="Parameters">Parameters</h2>

<dl>
 <dt><code>obj1</code> ... <code>objN</code></dt>
 <dd>Uma lista de objetos JavaScript para exibir. A representação por escrito de cada um desses objetos é exibida na ordem com a qual foram inseridos na função.</dd>
 <dt><code>msg</code></dt>
 <dd>Uma string JavaScript com zero ou mais substituições.</dd>
 <dt><code>subst1</code> ... <code>substN</code></dt>
 <dd>Strings ou objetos JavaScript para substituirem as marcações de substituição em <code>msg</code>. Estas substituições ocorrem de um para um e na ordem em que são passadas para a console.log.</dd>
</dl>

<p>Veja <a href="/en-US/docs/DOM/console#Outputting_text_to_the_console" title="DOM/console#Outputting_text_to_the_console">Exibindo texto na console</a> na documentação do objeto {{domxref("console")}} para mais detalhes.</p>

<h2 id="Specification" name="Specification">Especificação</h2>

<p>Não faz parte de nenhuma especificação.</p>

<h2 id="Browser_compatibility">Compatibilidade com navegadores</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Característica</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Suporte básico</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("2.0")}}</td>
   <td>8</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td>Strings de substituição</td>
   <td>
    <p>{{CompatVersionUnknown}}</p>

    <p>{{CompatChrome(28)}}</p>

    <p>%d - se um valor fracional negativo é passado, ele será arredondado para baixo, exemplo: -0,35 será arredondado para 1</p>
   </td>
   <td>{{CompatGeckoDesktop("9.0")}}</td>
   <td>
    <p>10 - parcial</p>

    <p>%c - não suportado<br>
     <span style="line-height: 1.572;">%d - irá renderizar como 0 quando NaN</span></p>
   </td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Característica</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Suporte básico</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile("2.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td>Strings de substituição</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoMobile("9.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="Ver_também">Ver também</h2>

<ul>
 <li><a class="external" href="http://www.opera.com/dragonfly/documentation/console/">Opera Dragonfly documentation: Console</a></li>
 <li><a class="external" href="http://msdn.microsoft.com/library/gg589530">MSDN: Using the F12 Tools Console to View Errors and Status</a></li>
 <li><a href="http://getfirebug.com/wiki/index.php/Console_API" title="http://getfirebug.com/wiki/index.php/Console_API">Firebug wiki: Console API</a> - Firebug supports additional features in its console.log() implementation, such as <a href="http://www.softwareishard.com/blog/firebug/firebug-tip-styled-logging/" title="http://www.softwareishard.com/blog/firebug/firebug-tip-styled-logging/">styled logging</a>.</li>
 <li><a href="http://nodejs.org/docs/latest/api/console.html#console_console_log_data">NodeJS: Console API</a></li>
</ul>