Re: Using a logging.Logger in a C extension

2019-10-04 Thread dieter
Ian Pilcher writes: > I am working my way through writing a C extension, and I've realized > that I need to log a few messages from the C code. Have a look at "cython". It significantly facilitates the realisation of C extensions, drastically reduces risks to make something wrong and makes it

Using a logging.Logger in a C extension

2019-10-04 Thread Ian Pilcher
I am working my way through writing a C extension, and I've realized that I need to log a few messages from the C code. Ideally, I would pass my existing Logging.logger object into my C function and use PyObject_CallMethod to call the appropriate method on it (info, debug, etc.).