Skip to content

Implement optional logging configuration in the ABI. #14

@AraHaan

Description

@AraHaan

Proposal:

I feel like the ABI should have an awaitable_set_debug() ABI function that users can call when they compile their extension with _DEBUG/DEBUG defined:

  • In debug when that ABI is called it sets an internal only global structure that configures logging to a file named pyawaitable.log in the current active directory of the running python interpreter.
    • It would then from within any and all following ABI calls logs all reference counts (in case of memory leak or decref too much), errors (if applicable), results (say ones set from SetResult, and also log if callbacks fail so it can help pinpoint which callback might have a problem (or causes an Access Violation to make debugging easier in user code).

I feel like this sort of ABI would be great and must be set before the init ABI function is called. Any additional calls to it does nothing.

Metadata

Metadata

Assignees

Labels

externalThis has to do with something outside of the PyAwaitable corefeatureNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions