Logging

Baran Gökçekli baran200167 at gmail.com
Sat Nov 19 05:44:21 EST 2022


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.

 




More information about the Python-list mailing list