Default logging as part of the language

Ned Batchelder ned at nedbatchelder.com
Sat Jul 29 07:28:41 EDT 2017


On 7/29/17 5:12 AM, ttopolewski at gmail.com wrote:
> Hello,
> I'm wondering what do You think about some default logging that can become a part of the Python language and part of the development workflow.
>
> I would see it as develop in debug mode untill debug is removed intentionally.
> It would include:
> - standard logging location for new development
> - some incentive to remove logging
>
>
> For example new keyword defd - something that would:
> - act as regular def, but log own identification and input/output __repr__ to /var/log/{processname.processid}
> - send WARN to stdout if filename of function/method defd definition time is old(like 2y.o?) to make people to replace defd as regular def
>
>
> PS. I don't have example implementation and I have not tried such approach so I can't say by experience if it makes any sense. But still I think it can be at least something to consider.
>
This sounds like a great thing to provide as a library. There's no need
for a new keyword.  A function decorator could do what you are describing.

--Ned.



More information about the Python-list mailing list