I have a program using the logging
module and the print
statement. The logging is to inform the user what the program is doing, for example
logging.info("downloading HTML")
time.sleep(1)
logging.info("parsing HTML")
time.sleep(1)
print "the result"
at the end the output on the screen (mixing stdout and stderr) will be:
INFO:downloading HTML
INFO:parsing HTML
the result
I want to hide the last logging output when the next logging output is displayed or when the print is called. For example, start the program, you will see:
INFO:download HTML
wait one seconds, the next info "parsing HTML"
will replace the previous "downloading HTML"
, so on the screen you will see only:
INFO:parsing HTML
and nothing else before, then wait one second, I want to see on the screen only:
"the result"
I want this feauture only when logging on the stderr, and not when logging to a file for example, there I want to see all the logging
outputs.
Is it possible?