If BMTOOLS_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``
()
| 46 | |
| 47 | |
| 48 | def _get_default_logging_level(): |
| 49 | """ |
| 50 | If BMTOOLS_VERBOSITY env var is set to one of the valid choices return that as the new default level. If it is |
| 51 | not - fall back to ``_default_log_level`` |
| 52 | """ |
| 53 | env_level_str = os.getenv("BMTOOLS_VERBOSITY", None) |
| 54 | if env_level_str: |
| 55 | if env_level_str in log_levels: |
| 56 | return log_levels[env_level_str] |
| 57 | else: |
| 58 | logging.getLogger().warning( |
| 59 | f"Unknown option BMTOOLS_VERBOSITY={env_level_str}, " |
| 60 | f"has to be one of: { ', '.join(log_levels.keys()) }" |
| 61 | ) |
| 62 | return _default_log_level |
| 63 | |
| 64 | |
| 65 | def _get_library_name() -> str: |
no outgoing calls
no test coverage detected