MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / _get_default_logging_level

Function _get_default_logging_level

bmtools/utils/logging.py:48–62  ·  view source on GitHub ↗

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``

()

Source from the content-addressed store, hash-verified

46
47
48def _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
65def _get_library_name() -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected