If DIFFUSERS_VERBOSITY env var is set to one of the valid choices return that as the new default level. If it is not - fall back to `_default_log_level`
()
| 68 | |
| 69 | |
| 70 | def _get_default_logging_level() -> int: |
| 71 | """ |
| 72 | If DIFFUSERS_VERBOSITY env var is set to one of the valid choices return that as the new default level. If it is |
| 73 | not - fall back to `_default_log_level` |
| 74 | """ |
| 75 | env_level_str = os.getenv("DIFFUSERS_VERBOSITY", None) |
| 76 | if env_level_str: |
| 77 | if env_level_str in log_levels: |
| 78 | return log_levels[env_level_str] |
| 79 | else: |
| 80 | logging.getLogger().warning( |
| 81 | f"Unknown option DIFFUSERS_VERBOSITY={env_level_str}, has to be one of: {', '.join(log_levels.keys())}" |
| 82 | ) |
| 83 | return _default_log_level |
| 84 | |
| 85 | |
| 86 | def _get_library_name() -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…