khmer icon indicating copy to clipboard operation
khmer copied to clipboard

Investigate adding a logging framework

Open ctb opened this issue 9 years ago • 7 comments

It would be nice to have a unified way to enable/disable logging at both the Python and C++ levels.

For a survey, see:

https://twitter.com/ctitusbrown/status/601745781771603971 https://twitter.com/ctitusbrown/status/601745886054653952

and conversations therein.

ctb avatar May 22 '15 14:05 ctb

http://netlogger.lbl.gov/software might be good

mr-c avatar Jul 27 '15 23:07 mr-c

I just checked out netlogger, it looks quite bloated / poorly documented / confusing. After considerably more googling than I expected this to require, I came across an old but dead simple library, cx_Logging, that seems to do what we need. The one line description:

cx_Logging is a Python extension module that behaves similarly to the logging module found in the standard Python library but has a C interface in addition to a Python interface.

ie, exactly what we need. That there are so few solutions for this use-case is actually rather startling, and the general advice is "wrap a C++ logger in CPython," without linking to any code.

The license is... non-standard, but it's pretty much a "do anything, don't quote as us endorsers of your project":

Links:

  1. Main: http://cx-logging.sourceforge.net/
  2. Documentation: http://cx-logging.sourceforge.net/html/index.html
  3. License: http://cx-logging.sourceforge.net/LICENSE.txt

Thoughts?

camillescott avatar Jul 28 '15 14:07 camillescott

+1 to cx-logging

mr-c avatar Jul 28 '15 23:07 mr-c

Also, that's a standard 3 clause BSD license, same as us.

mr-c avatar Jul 28 '15 23:07 mr-c

Seems to be updated here: https://bitbucket.org/anthony_tuininga/cx_logging/

On Tue, Jul 28, 2015 at 7:31 PM, Michael R. Crusoe <[email protected]

wrote:

Also, that's a standard 3 clause BSD license, same as us.

— Reply to this email directly or view it on GitHub https://github.com/dib-lab/khmer/issues/1024#issuecomment-125781436.

luizirber avatar Jul 29 '15 00:07 luizirber

-1 on doing anything more about an external logging package before 2.0, y'all. Let's get this release out.

ctb avatar Jul 29 '15 12:07 ctb

https://www.ccdatalab.org/blog/2019/2/28/better-logging-in-python

ctb avatar Apr 12 '19 00:04 ctb