What is the simplest method for temporarily changing the logging message format, in Python (through the logging module)?
The goal is to have some standard message fo
if you want to dynamic change format of log. it could be made like this.
logger = logging.getLogger()
# Change format of handler for the logger
logger.handlers[0].setFormatter(logging.Formatter('%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s'))
# Print log
logging.info(log)
# return other format
logger.handlers[0].setFormatter(logging.Formatter('%(message)s'))