How can I solve this question? There is a module called ‘logging’ to employ logging facility in Python.
import logging logging. info('Just a normal message' ) Logging.warning('Not fatal but still noted') logging.error('There is something wrong') You are expected to implement logging feature to an existing code which uses the function below. def my_ugly_debug(s, level=0): pre_text = [ "INFO", "WARNING", "ERROR" ] print(f"{pre_text[level]}: {s}") You are not allowed to make changes in my_ugly_debug, so find another way. -- https://mail.python.org/mailman/listinfo/python-list