[Python-ideas] Efficient debug logging

Barry barry at barrys-emacs.org
Fri Feb 17 18:05:08 EST 2017


> On 16 Feb 2017, at 21:03, Abe Dillon <abedillon at gmail.com> wrote:
> 
> I personally don't see why you can't use floats for log levels, but I'm interested to know how people are using logs such that they need dozens of levels. That, however; is tangential to the discussion about conditional execution of an expensive function.

Its not lots of levels its lots of categories.
I did add one level, INFOHEADER, but not for debug.

It you are interested in what I did you could look at this project:

https://github.com/barry-scott/scm-workbench

Have a look at:

https://github.com/barry-scott/scm-workbench/blob/master/Source/Scm/wb_scm_debug.py
https://github.com/barry-scott/scm-workbench/blob/master/Source/Common/wb_debug.py

Then look at almost any module and see the use of the _debug calls.

Barry




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170217/0ec34270/attachment.html>


More information about the Python-ideas mailing list