[Tutor] Logging script output

Alan Gauld alan.gauld at btinternet.com
Sun Dec 15 21:51:42 CET 2013


On 15/12/13 18:01, Tobias M. wrote:

> Yes, I think the logging module is the best way to do it.
> And it's pretty easy, see this minimal example:
>
> import logging
>
> logging.basicConfig(filename="foo.log", level=logging.DEBUG)
> logging.debug("This is a log message")

But The OP didn't ask how to record log messages,
for which logging is great.

He asked how to log *the output* of his program.
I'm not so sure logging is the best way to do that.
But it depends on what he really meant by output...

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list