Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if r is not None:
reset = r
if v is None:
v = 4
if isinstance(v, str):
v = _VERBOSITY_LEVELS_FROM_STRINGS[v]
if v == 3: # insert "--> " before hints
msg = ("-->",) + msg
if v >= 4 and not no_indent:
msg = (" ",) + msg
if _settings_verbosity_greater_or_equal_than(v):
if not time and not memory and len(msg) > 0:
_write_log(*msg, end=end)
if reset:
try:
settings._previous_memory_usage, _ = get_memory_usage()
except:
pass
settings._previous_time = get_time()
if time:
elapsed = get_passed_time()
msg = msg + (f"({_sec_to_str(elapsed)})",)
_write_log(*msg, end=end)
if memory:
_write_log(get_memory_usage(), end=end)
msg = (" ",) + msg
if _settings_verbosity_greater_or_equal_than(v):
if not time and not memory and len(msg) > 0:
_write_log(*msg, end=end)
if reset:
try:
settings._previous_memory_usage, _ = get_memory_usage()
except:
pass
settings._previous_time = get_time()
if time:
elapsed = get_passed_time()
msg = msg + (f"({_sec_to_str(elapsed)})",)
_write_log(*msg, end=end)
if memory:
_write_log(get_memory_usage(), end=end)