mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-21 16:50:02 +02:00
docs: adds section explaining how to set the log level
This commit is contained in:
parent
8ad7ea511c
commit
5e16eb9321
22
README.md
22
README.md
@ -20,6 +20,7 @@
|
|||||||
- [Understanding Service Persistence](#understanding-service-persistence)
|
- [Understanding Service Persistence](#understanding-service-persistence)
|
||||||
- [Understanding Tasks in pydase](#understanding-tasks-in-pydase)
|
- [Understanding Tasks in pydase](#understanding-tasks-in-pydase)
|
||||||
- [Understanding Units in pydase](#understanding-units-in-pydase)
|
- [Understanding Units in pydase](#understanding-units-in-pydase)
|
||||||
|
- [Changing the Log Level](#changing-the-log-level)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
@ -377,6 +378,27 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
For more information about what you can do with the units, please consult the documentation of [`pint`](https://pint.readthedocs.io/en/stable/).
|
For more information about what you can do with the units, please consult the documentation of [`pint`](https://pint.readthedocs.io/en/stable/).
|
||||||
|
|
||||||
|
## Changing the Log Level
|
||||||
|
|
||||||
|
You can change the log level of loguru by either
|
||||||
|
1. (RECOMMENDED) setting the `ENVIRONMENT` environment variable to "production" or "development"
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ENVIRONMENT="production" python -m <module_using_pydase>
|
||||||
|
```
|
||||||
|
|
||||||
|
The production environment will only log messages above "INFO", the development environment (default) logs everything above "DEBUG".
|
||||||
|
|
||||||
|
2. calling the `pydase.utils.logging.setup_logging` function with the desired log level
|
||||||
|
|
||||||
|
```python
|
||||||
|
# <your_script.py>
|
||||||
|
|
||||||
|
from pydase.utils.logging import setup_logging
|
||||||
|
|
||||||
|
setup_logging("INFO")
|
||||||
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The full documentation provides more detailed information about `pydase`, including advanced usage examples, API references, and tips for troubleshooting common issues. See the [full documentation](URL_TO_YOUR_DOCUMENTATION) for more information.
|
The full documentation provides more detailed information about `pydase`, including advanced usage examples, API references, and tips for troubleshooting common issues. See the [full documentation](URL_TO_YOUR_DOCUMENTATION) for more information.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user