Skip to content

Commit 9890602

Browse files
committed
Update Python logging examples in documentation.
This adds information to the logging docs in `documentation/webdriver/troubleshooting/`` for setting up log handlers in Python. This is necessary to get log output.
1 parent 7b4d21b commit 9890602

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ take a look at the [Selenium Logger project](https://github.com/titusfortner/sel
2727
Python logs are typically created per module. You can match all submodules by referencing the top
2828
level module. So to work with all loggers in selenium module, you can do this:
2929
{{< gh-codeblock path="/examples/python/tests/troubleshooting/test_logging.py#L5" >}}
30+
You must also set a handler (`StreamHandler`, `FileHandler('/path/to/log')`, etc).
31+
For example, to see logs in the console, you can do this:
32+
```py
33+
handler = logging.StreamHandler()
34+
logger.addHandler(handler)
35+
```
3036
{{% /tab %}}
3137
{{% tab header="CSharp" %}}
3238
.NET logger is managed with a static class, so all access to logging is managed simply by referencing `Log` from the `OpenQA.Selenium.Internal.Logging` namespace.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ take a look at the [Selenium Logger project](https://github.com/titusfortner/sel
2727
Python logs are typically created per module. You can match all submodules by referencing the top
2828
level module. So to work with all loggers in selenium module, you can do this:
2929
{{< gh-codeblock path="/examples/python/tests/troubleshooting/test_logging.py#L5" >}}
30+
You must also set a handler (`StreamHandler`, `FileHandler('/path/to/log')`, etc).
31+
For example, to see logs in the console, you can do this:
32+
```py
33+
handler = logging.StreamHandler()
34+
logger.addHandler(handler)
35+
```
3036
{{% /tab %}}
3137
{{% tab header="CSharp" %}}
3238
.NET logger is managed with a static class, so all access to logging is managed simply by referencing `Log` from the `OpenQA.Selenium.Internal.Logging` namespace.

website_and_docs/content/documentation/webdriver/troubleshooting/logging.pt-br.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ take a look at the [Selenium Logger project](https://github.com/titusfortner/sel
2727
Python logs are typically created per module. You can match all submodules by referencing the top
2828
level module. So to work with all loggers in selenium module, you can do this:
2929
{{< gh-codeblock path="/examples/python/tests/troubleshooting/test_logging.py#L5" >}}
30+
You must also set a handler (`StreamHandler`, `FileHandler('/path/to/log')`, etc).
31+
For example, to see logs in the console, you can do this:
32+
```py
33+
handler = logging.StreamHandler()
34+
logger.addHandler(handler)
35+
```
3036
{{% /tab %}}
3137
{{% tab header="CSharp" %}}
3238
.NET logger is managed with a static class, so all access to logging is managed simply by referencing `Log` from the `OpenQA.Selenium.Internal.Logging` namespace.

website_and_docs/content/documentation/webdriver/troubleshooting/logging.zh-cn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ Java日志并不简单直接,
3030
Python logs are typically created per module. You can match all submodules by referencing the top
3131
level module. So to work with all loggers in selenium module, you can do this:
3232
{{< gh-codeblock path="/examples/python/tests/troubleshooting/test_logging.py#L5" >}}
33+
You must also set a handler (`StreamHandler`, `FileHandler('/path/to/log')`, etc).
34+
For example, to see logs in the console, you can do this:
35+
```py
36+
handler = logging.StreamHandler()
37+
logger.addHandler(handler)
38+
```
3339
{{% /tab %}}
3440
{{% tab header="CSharp" %}}
3541
.NET logger is managed with a static class, so all access to logging is managed simply by referencing `Log` from the `OpenQA.Selenium.Internal.Logging` namespace.

0 commit comments

Comments
 (0)