[Tutor] Logging script output

Reuben reuben.dlink at gmail.com
Mon Dec 16 02:46:39 CET 2013


Thanks everyone - your posts helped me.
On 16-Dec-2013 2:22 AM, "Alan Gauld" <alan.gauld at btinternet.com> wrote:

> 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
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131216/27da01ba/attachment.html>


More information about the Tutor mailing list