PyWart: The problem with "print"

Alister alister.ware at ntlworld.com
Mon Jun 3 04:01:54 EDT 2013


On Mon, 03 Jun 2013 17:17:12 +1000, Chris Angelico wrote:

> On Mon, Jun 3, 2013 at 3:49 PM, Michael Torrie <torriem at gmail.com>
> wrote:
>> On 06/02/2013 12:18 PM, Rick Johnson wrote:
>>> On Sunday, June 2, 2013 12:49:02 PM UTC-5, Dan Sommers wrote:
>>>> On Mon, 03 Jun 2013 03:20:52 +1000, Chris Angelico wrote:
>>>>> On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson
>>>> [...] Or use the logging module.  It's easy to get going quickly
>>>> (just call logging.basicConfig at startup time), and with a little
>>>> care and feeding, you can control the output in more ways than can
>>>> fit into the margin. Oh, yeah, I'm sure it introduces some overhead. 
>>>> So does everything else.
>>>
>>> I hate log files, at least during development or testing. I prefer to
>>> debug on the command line or using my IDE. Log files are for release
>>> time, not development.
>>
>> Except that it's not.  Have you even looked at what the logging module
>> is?  It most certainly can log to stderr if you provide no logging
>> handler to write to a file.
> 
> Plus, writing to a file actually makes a lot of sense for development
> too. It's far easier to run the program the same way in dev and release,
> which often means daemonized. I like to have Upstart manage all my
> services, for instance.
> 
> ChrisA

further point
the production logging code needs to be implemented and tested at 
development time anyway so why not make use of it instead of creating 
additional redundant code?



-- 
It is a lesson which all history teaches wise men, to put trust in ideas,
and not in circumstances.
		-- Emerson



More information about the Python-list mailing list