ecerulm opened a new pull request #14607:
URL: https://github.com/apache/airflow/pull/14607
Currently `airflow plugins` with suppress all errors, and warnings, so for
example if the plugins contain errors, the output will simply show
```
airflow plugins
No plugins loaded
```
There is the flag `--verbose` that will preserve the log output:
```
airflow plugins --verbose
[2021-03-04 17:46:38,569] {plugins_manager.py:243} ERROR - No module named
'nonexisting'
Traceback (most recent call last):
File "/Users/ecerulm/git/airflow/airflow/plugins_manager.py", line 233, in
load_plugins_from_plugin_directory
loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "/Users/ecerulm/git/airflow/plugins/errored_plugin.py", line 13, in
<module>
import nonexisting
ModuleNotFoundError: No module named 'nonexisting'
[2021-03-04 17:46:38,570] {plugins_manager.py:244} ERROR - Failed to import
plugin /Users/ecerulm/git/airflow/plugins/errored_plugin.py
No plugins loaded
```
This PR aims to change the default suppression level so that errors are
shown by default on `airflow plugins` by introducing a parameter to the
`@suppress_logs_and_warnings` decorator to set the supression level.
so `@suppress_log_and_warnings()` will supress all logs but
`@suppress_log_and_warnings(level=logging.WARNING)` will still show `ERROR` and
`CRITICAL` logs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]