Skip to content

Commit 0e8d25c

Browse files
committed
fix: changed html tags to markdown. Changed other languages (ja,pt,zh)
1 parent d263c2a commit 0e8d25c

File tree

4 files changed

+698
-286
lines changed

4 files changed

+698
-286
lines changed

website_and_docs/content/documentation/webdriver/troubleshooting/logging.en.md

Lines changed: 89 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ of the program.
2121
{{< tab header="CSharp" >}}
2222
{{< alert-content >}}{{< /alert-content >}}
2323
{{< /tab >}}
24-
{{< tab header="Ruby" >}}
25-
<p>Ruby uses a custom implementation of the default `Logger` class with some interesting additional features.</p>
26-
<pre>
27-
logger = Selenium::WebDriver.logger</pre>
28-
{{< /tab >}}
29-
{{< tab header="JavaScript" >}}
30-
<pre>
31-
const logging = require('selenium-webdriver/lib/logging')
32-
logger = logging.getLogger('webdriver')</pre>
33-
{{< /tab >}}
24+
{{% tab header="Ruby" %}}
25+
Ruby uses a custom implementation of the default `Logger` class with some interesting additional features.
26+
27+
logger = Selenium::WebDriver.logger
28+
{{% /tab %}}
29+
{{% tab header="JavaScript" %}}
30+
const logging = require('selenium-webdriver/lib/logging')
31+
logger = logging.getLogger('webdriver')
32+
{{% /tab %}}
3433
{{< tab header="Kotlin" >}}
3534
{{< alert-content >}}{{< /alert-content >}}
3635
{{< /tab >}}
@@ -49,18 +48,18 @@ Logger level helps to filter out logs based on their severity.
4948
{{< tab header="CSharp" >}}
5049
{{< alert-content >}}{{< /alert-content >}}
5150
{{< /tab >}}
52-
{{< tab header="Ruby" >}}
53-
<p>Levels are: <code>:debug</code>, <code>:info</code>, <code>:warn</code>, <code>:error</code>, <code>:fatal</code>. Default is <code>:warn</code>.</p>
54-
<p>To change the level of the logger:</p>
55-
<pre>
56-
Selenium::WebDriver.logger.level = :info</pre>
57-
{{< /tab >}}
58-
{{< tab header="JavaScript" >}}
59-
<p>Levels are: <code>OFF</code>, <code>SEVERE</code>, <code>WARNING</code>, <code>INFO</code>, <code>DEBUG</code>, <code>FINE</code>, <code>FINER</code>, <code>FINEST</code>, <code>ALL</code>. Default is <code>OFF</code>.</p>
60-
<p>To change the level of the logger:</p>
61-
<pre>
62-
logger.setLevel(logging.Level.INFO)</pre>
63-
{{< /tab >}}
51+
{{% tab header="Ruby" %}}
52+
Levels are: `:debug`, `:info`, `:warn`, `:error`, `:fatal`. Default is `:warn`.
53+
To change the level of the logger:
54+
55+
Selenium::WebDriver.logger.level = :info
56+
{{% /tab %}}
57+
{{% tab header="JavaScript" %}}
58+
Levels are: `OFF`, `SEVERE`, `WARNING`, `INFO`, `DEBUG`, `FINE`, `FINER`, `FINEST`, `ALL`. Default is `OFF`.
59+
To change the level of the logger:
60+
61+
logger.setLevel(logging.Level.INFO)
62+
{{% /tab %}}
6463
{{< tab header="Kotlin" >}}
6564
{{< alert-content >}}{{< /alert-content >}}
6665
{{< /tab >}}
@@ -82,29 +81,29 @@ Our policy is to mark things as deprecated for 3 releases and then remove them.
8281
{{< tab header="CSharp" >}}
8382
{{< alert-content >}}{{< /alert-content >}}
8483
{{< /tab >}}
85-
{{< tab header="Ruby" >}}
86-
<p>Ruby logs deprecations as warnings, specifying what is changing, what needs to be
87-
used instead. It may include additional messages, and always includes an ID.</p>
88-
89-
<p>For example:</p>
90-
<blockquote>2022-12-24 16:07:09 WARN Selenium [DEPRECATION] [:jwp_caps] \`Capabilities#version=\` is deprecated. Use \`Capabilities#browser_version=\` instead.</blockquote>
91-
92-
<p>Because these items can get annoying, we've provided an easy way to turn them off.</p>
93-
94-
<p>To turn off a specific warning, set the ID to ignore:</p>
95-
<pre>
96-
Selenium::WebDriver.logger.ignore(:jwp_caps)</pre>
97-
<br>
98-
<p>It accepts an `Array` to turn off multiple IDs:</p>
99-
<pre>
100-
Selenium::WebDriver.logger.ignore(%i[jwp_caps pause pauses])</pre>
101-
<br>
102-
<p>To turn off all *deprecation* notices:</p>
103-
<pre>
104-
Selenium::WebDriver.logger.ignore(:deprecations)</pre>
105-
{{< /tab >}}
84+
{{% tab header="Ruby" %}}
85+
Ruby logs deprecations as warnings, specifying what is changing, what needs to be
86+
used instead. It may include additional messages, and always includes an ID.
87+
88+
For example:
89+
> 2022-12-24 16:07:09 WARN Selenium [DEPRECATION] [:jwp_caps] \`Capabilities#version=\` is deprecated. Use \`Capabilities#browser_version=\` instead.
90+
91+
Because these items can get annoying, we've provided an easy way to turn them off.
92+
93+
To turn off a specific warning, set the ID to ignore:
94+
95+
Selenium::WebDriver.logger.ignore(:jwp_caps)
96+
97+
It accepts an `Array` to turn off multiple IDs:
98+
99+
Selenium::WebDriver.logger.ignore(%i[jwp_caps pause pauses])
100+
101+
To turn off all *deprecation* notices:
102+
103+
Selenium::WebDriver.logger.ignore(:deprecations)
104+
{{% /tab %}}
106105
{{< tab header="JavaScript" >}}
107-
{{< alert-content >}}{{< /alert-content >}}
106+
{{< alert-content />}}
108107
{{< /tab >}}
109108
{{< tab header="Kotlin" >}}
110109
{{< alert-content >}}{{< /alert-content >}}
@@ -128,14 +127,14 @@ Different languages have different level to log information.
128127
{{< tab header="CSharp" >}}
129128
{{< alert-content >}}{{< /alert-content >}}
130129
{{< /tab >}}
131-
{{< tab header="Ruby" >}}
132-
<p>Because the Ruby <code>Logger</code> class only has one "debug" level, Selenium is currently using the <code>:info</code> level as a general debug mode, and <code>:debug</code> as a lower level debug mode.
130+
{{% tab header="Ruby" %}}
131+
Because the Ruby `Logger` class only has one "debug" level, Selenium is currently using the `:info` level as a general debug mode, and `:debug` as a lower level debug mode.
133132
To bring things in line with other languages, we are considering <a href="https://github.com/SeleniumHQ/selenium/issues/11797">changing this behavior</a>.
134-
For now, both info and warnings are handled at the default <code>:warn</code> level.</p>
135-
{{< /tab >}}
136-
{{< tab header="JavaScript" >}}
137-
Logs useful information at level: <code>INFO</code>
138-
{{< /tab >}}
133+
For now, both info and warnings are handled at the default `:warn` level.
134+
{{% /tab %}}
135+
{{% tab header="JavaScript" %}}
136+
Logs useful information at level: `INFO`
137+
{{% /tab %}}
139138
{{< tab header="Kotlin" >}}
140139
{{< alert-content >}}{{< /alert-content >}}
141140
{{< /tab >}}
@@ -155,12 +154,12 @@ The debug log level is used for information that may be needed for diagnosing is
155154
{{< tab header="CSharp" >}}
156155
{{< alert-content >}}{{< /alert-content >}}
157156
{{< /tab >}}
158-
{{< tab header="Ruby" >}}
159-
Logs debugging details at level: <code>:info</code> and <code>:debug</code>
160-
{{< /tab >}}
161-
{{< tab header="JavaScript" >}}
162-
Logs debugging details at level: <code>FINER</code> and <code>FINEST</code>
163-
{{< /tab >}}
157+
{{% tab header="Ruby" %}}
158+
Logs debugging details at level: `:info` and `:debug`
159+
{{% /tab %}}
160+
{{% tab header="JavaScript" %}}
161+
Logs debugging details at level: `FINER` and `FINEST`
162+
{{% /tab %}}
164163
{{< tab header="Kotlin" >}}
165164
{{< alert-content >}}{{< /alert-content >}}
166165
{{< /tab >}}
@@ -179,43 +178,39 @@ Logs can be displayed on `stdout` or stored in a file.
179178
{{< tab header="CSharp" >}}
180179
{{< alert-content >}}{{< /alert-content >}}
181180
{{< /tab >}}
182-
{{< tab header="Ruby" >}}
183-
<p>By default, logs are sent to the console in `stdout`.</p>
184-
<p>To store the logs in a file:</p>
185-
<pre>
186-
Selenium::WebDriver.logger.output = '/path/to/selenium.log'</pre>
187-
<br>
188-
<p>Sample Output:</p>
189-
<pre>
190-
2023-02-08 12:31:23 INFO Selenium -> POST session/8b83ff54712d0a247937d045f8c8e171/url
191-
2023-02-08 12:31:23 INFO Selenium >>> http://127.0.0.1:9515/session/8b83ff54712d0a247937d045f8c8e171/url | {"url":"https://www.selenium.dev/selenium/web/web-form.html"}
192-
2023-02-08 12:31:23 INFO Selenium <- {"value":null}</pre>
193-
{{< /tab >}}
194-
{{< tab header="JavaScript" >}}
195-
<p>Send logs to console output:</p>
196-
<pre>
197-
logging.installConsoleHandler()</pre>
198-
<br>
199-
<p>Sample Output:</p>
200-
<pre>
201-
[2023-03-21T22:28:20Z] [FINER] [webdriver.http.Executor] >>> POST /session/0208994573cca3250a1066424c1b915c/url<br>
202-
[2023-03-21T22:28:22Z] [FINER] [webdriver.http.Executor] >>>
203-
POST /session/0208994573cca3250a1066424c1b915c/url HTTP/1.1<br>
204-
accept: application/json; charset=utf-8
205-
206-
{"url":"https://www.selenium.dev/selenium/web/web-form.html"}<br>
207-
<<<
208-
HTTP/1.1 200
209-
content-length: 14
210-
content-type: application/json; charset=utf-8
211-
cache-control: no-cache
212-
213-
{"value":null}</pre>
214-
<br>
215-
{{< alert-content >}}
216-
Store logs in a file.
217-
{{< /alert-content >}}
218-
{{< /tab >}}
181+
{{% tab header="Ruby" %}}
182+
By default, logs are sent to the console in `stdout`.
183+
To store the logs in a file:
184+
185+
Selenium::WebDriver.logger.output = '/path/to/selenium.log'
186+
187+
Sample Output:
188+
189+
2023-02-08 12:31:23 INFO Selenium -> POST session/8b83ff54712d0a247937d045f8c8e171/url
190+
2023-02-08 12:31:23 INFO Selenium >>> http://127.0.0.1:9515/session/8b83ff54712d0a247937d045f8c8e171/url | {"url":"https://www.selenium.dev/selenium/web/web-form.html"}
191+
2023-02-08 12:31:23 INFO Selenium <- {"value":null}
192+
{{% /tab %}}
193+
{{% tab header="JavaScript" %}}
194+
Send logs to console output:
195+
196+
logging.installConsoleHandler()
197+
198+
Sample Output:
199+
200+
[2023-03-21T22:28:20Z] [FINER] [webdriver.http.Executor] >>> POST /session/0208994573cca3250a1066424c1b915c/url
201+
[2023-03-21T22:28:22Z] [FINER] [webdriver.http.Executor] >>>
202+
POST /session/0208994573cca3250a1066424c1b915c/url HTTP/1.1
203+
accept: application/json; charset=utf-8
204+
205+
{"url":"https://www.selenium.dev/selenium/web/web-form.html"}
206+
<<<
207+
HTTP/1.1 200
208+
content-length: 14
209+
content-type: application/json; charset=utf-8
210+
cache-control: no-cache
211+
212+
{"value":null}
213+
{{% /tab %}}
219214
{{< tab header="Kotlin" >}}
220215
{{< alert-content >}}{{< /alert-content >}}
221216
{{< /tab >}}

0 commit comments

Comments
 (0)