[Tutor] Logging script output

Mark Lawrence breamoreboy at yahoo.co.uk
Sun Dec 15 19:05:48 CET 2013


On 15/12/2013 17:43, Reuben wrote:
> Hi,
>
> What is the best way to log the output of a python script execution.
>
> Do we need to use the logging module of python?
>
> Regards,
> Reuben
>

You don't need to, but why reinvent the wheel?  Use your favourite 
search engine to find lots of articles on how to customise logging to 
suit your own needs.

The logging module is also extremely useful for debugging when compared 
to print statements/functions.  The former you just change the logging 
level, the latter you have to insert and delete, or comment and uncomment.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list