turanalmammadov opened a new pull request, #62819:
URL: https://github.com/apache/airflow/pull/62819
### Motivation
Closes #56816
The current logging in `plugins_manager.py` has one generic timing debug
message regardless of whether:
- the plugins folder is empty (no plugins to load — normal operation)
- plugins failed to import (errors occurred)
This makes it hard for operators and developers to quickly understand the
plugin loading state.
### Changes
Updated `_get_plugins()` in `airflow-core/src/airflow/plugins_manager.py`:
**Before:**
```python
log.debug("Loading %d plugin(s) took %.2f ms", len(plugins), timer.duration)
```
**After:**
```python
if import_errors:
log.warning(
"Failed to load %d plugin(s): %s",
len(import_errors),
list(import_errors.keys()),
)
elif not plugins:
log.debug("No plugins loaded (plugins folder is empty or contains no
Airflow plugins)")
else:
log.debug("Loading %d plugin(s) took %.2f ms", len(plugins),
timer.duration)
```
### Why this approach
1. **Import errors** are elevated to `WARNING` so they are visible in
default log configurations and clearly list which plugins failed — making
debugging much easier.
2. **Empty plugins folder** gets a clear `DEBUG` message so developers
inspecting debug logs can understand why no plugins are active.
3. **Successful loads** retain the existing timing message (no regression).
### Testing
The change is straightforward — no new tests needed as the logic is covered
by existing plugin loading tests.
Made with [Cursor](https://cursor.com)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]