call the interface of python in the shell script, but python API prints the relevant information to the screen through the logging of python. I don"t know how to get these logging information in shell. Please advise. This is what the
code says:
import logging
......
logger = logging.getLogger("123")
......
def debug(msg):
logger.setLevel(logging.DEBUG)
debughandler = logging.StreamHandler()
debughandler.setLevel(logging.DEBUG)
fmt = "%(asctime)s - %(levelname)s - %(message)s"
formatter = logging.Formatter(fmt)
debughandler.setFormatter(formatter)
logger.addHandler(debughandler)
logger.debug(msg)
logger.removeHandler(debughandler)
how is the information printed through logger.debug (msg) captured in shell?