File tree Expand file tree Collapse file tree 4 files changed +40
-8
lines changed
website_and_docs/content/documentation/webdriver/troubleshooting Expand file tree Collapse file tree 4 files changed +40
-8
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,16 @@ take a look at the [Selenium Logger project](https://github.com/titusfortner/sel
2727Python logs are typically created per module. You can match all submodules by referencing the top
2828level 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:
30+ You must also create and add a log handler (` StreamHandler ` , ` FileHandler ` , etc).
31+
32+ To save logs to a file, you can do this:
33+ ``` py
34+ log_path = ' /path/to/log'
35+ handler = logging.FileHandler(log_path)
36+ logger.addHandler(handler)
37+ ```
38+
39+ To display logs in the console, you can do this:
3240``` py
3341handler = logging.StreamHandler()
3442logger.addHandler(handler)
Original file line number Diff line number Diff line change @@ -27,8 +27,16 @@ take a look at the [Selenium Logger project](https://github.com/titusfortner/sel
2727Python logs are typically created per module. You can match all submodules by referencing the top
2828level 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:
30+ You must also create and add a log handler (` StreamHandler ` , ` FileHandler ` , etc).
31+
32+ To save logs to a file, you can do this:
33+ ``` py
34+ log_path = ' /path/to/log'
35+ handler = logging.FileHandler(log_path)
36+ logger.addHandler(handler)
37+ ```
38+
39+ To display logs in the console, you can do this:
3240``` py
3341handler = logging.StreamHandler()
3442logger.addHandler(handler)
Original file line number Diff line number Diff line change @@ -27,8 +27,16 @@ take a look at the [Selenium Logger project](https://github.com/titusfortner/sel
2727Python logs are typically created per module. You can match all submodules by referencing the top
2828level 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:
30+ You must also create and add a log handler (` StreamHandler ` , ` FileHandler ` , etc).
31+
32+ To save logs to a file, you can do this:
33+ ``` py
34+ log_path = ' /path/to/log'
35+ handler = logging.FileHandler(log_path)
36+ logger.addHandler(handler)
37+ ```
38+
39+ To display logs in the console, you can do this:
3240``` py
3341handler = logging.StreamHandler()
3442logger.addHandler(handler)
Original file line number Diff line number Diff line change @@ -30,8 +30,16 @@ Java日志并不简单直接,
3030Python logs are typically created per module. You can match all submodules by referencing the top
3131level 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:
33+ You must also create and add a log handler (` StreamHandler ` , ` FileHandler ` , etc).
34+
35+ To save logs to a file, you can do this:
36+ ``` py
37+ log_path = ' /path/to/log'
38+ handler = logging.FileHandler(log_path)
39+ logger.addHandler(handler)
40+ ```
41+
42+ To display logs in the console, you can do this:
3543``` py
3644handler = logging.StreamHandler()
3745logger.addHandler(handler)
You can’t perform that action at this time.
0 commit comments