Moved log level description to README
This commit is contained in:
17
README.md
17
README.md
@@ -120,11 +120,18 @@ pytest --stresstest tests/turboPmac1/ax1/test_common.py
|
||||
Each motor has its own dedicated logger, whose loglevel can be set with the flag
|
||||
`--log=LEVEL`. `LEVEL` should be one of the `logging` - native levels - i.e.
|
||||
`DEBUG`, `INFO`, `WARNING`, `ERROR` or `CRITICAL` (see
|
||||
https://docs.python.org/3/library/logging.html#logging-levels). To see the level
|
||||
description, run:
|
||||
```bash
|
||||
pytest --help | grep -- '--log='
|
||||
```
|
||||
https://docs.python.org/3/library/logging.html#logging-levels).
|
||||
|
||||
In the context of this test framework, the log levels mean the following:
|
||||
- `DEBUG`: Show all raw caput and caget commands
|
||||
- `INFO`: Write high-level commands (e.g. move, stop, home etc.)
|
||||
- `WARNING`: Not used
|
||||
- `ERROR`: Serious error (e.g. motor could not be enabled / disabled)
|
||||
- `CRITICAL`: Not used
|
||||
All error levels higher than the defined one are forwarded to the Pytest
|
||||
logger.
|
||||
|
||||
The default log level is `CRITICAL`.
|
||||
|
||||
To specify the log level for a test run:
|
||||
```bash
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from pathlib import Path
|
||||
import logging
|
||||
import textwrap
|
||||
|
||||
from caproto.sync.client import read
|
||||
import pytest
|
||||
@@ -48,16 +47,7 @@ def pytest_addoption(parser):
|
||||
"--log",
|
||||
action="store",
|
||||
default="ERROR",
|
||||
help=textwrap.dedent("""
|
||||
Set log level:
|
||||
- DEBUG: Show all raw caput and caget commands
|
||||
- INFO: Write high-level commands (e.g. move, stop, home etc.)
|
||||
- WARNING: Not used
|
||||
- ERROR: Serious error (e.g. motor could not be enabled / disabled)
|
||||
- CRITICAL: Not used
|
||||
All error levels higher than the defined one are forwarded to the Pytest
|
||||
logger.
|
||||
""").replace("\n", " ")
|
||||
help="Set log level: DEBUG, INFO, WARNING, ERROR or CRITICAL"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user