MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / get_log_level_from_string

Function get_log_level_from_string

deepspeed/utils/logging.py:183–190  ·  view source on GitHub ↗

converts a log level string into its numerical equivalent. e.g. "info" => `logging.INFO`

(log_level_str)

Source from the content-addressed store, hash-verified

181
182
183def get_log_level_from_string(log_level_str):
184 """converts a log level string into its numerical equivalent. e.g. "info" => `logging.INFO`
185 """
186 log_level_str = log_level_str.lower()
187 if log_level_str not in log_levels:
188 raise ValueError(
189 f"{log_level_str} is not one of the valid logging levels. Valid log levels are {log_levels.keys()}.")
190 return log_levels[log_level_str]
191
192
193def set_log_level_from_string(log_level_str, custom_logger=None):

Callers 2

should_log_leFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected