python - Suspend the formatting of the logger, then go back to it -
i have logging configuration log file , console: logging.basicconfig(filename=logfile, filemode='w', level=numlevel, format='%(asctime)s - %(levelname)s - %(name)s:%(funcname)s - %(message)s') # add console messages console = logging.streamhandler() console.setlevel(logging.info) consoleformatter = logging.formatter('%(asctime)s - %(levelname)s - %(message)s') console.setformatter(consoleformatter) logging.getlogger('').addhandler(console) at point in script, need interact user printing summary , asking confirmation. summary produced prints in loop. suspend current format of console logs, can printout 1 big block of text question @ end , wait user input. still want of logged file! the function in module, tried following : logger = logging.getlogger(__name__) def summaryfunc: logger.info('normal logging business') clearformatter = logging.formatter('%(m...